sketchucation logo sketchucation
    • Login
    πŸ€‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    Create an xml file using sketchup ruby API

    Scheduled Pinned Locked Moved Developers' Forum
    5 Posts 2 Posters 1.2k Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M Offline
      MaryamR
      last edited by

      hello Sketchup developers,

      I'm working on a project which is creating a Sketchup extension that collects data and generates it as an XML file, need to create an XML file that contains data (area,
      volume ...) from a sketchup house model, using sketchup Ruby API.

      I found methods like Nokogiri, REXML and Builder but do they work even for the Sketchup Ruby API ? if so how ?

      Does anyone have any idea or examples ?

      thank you !

      1 Reply Last reply Reply Quote 0
      • TIGT Offline
        TIG Moderator
        last edited by

        Your profile says you are using the obsolete v8. πŸ˜•
        This has very limited access to additional external Ruby methods.

        However, the newer version of Ruby, which ships with the newer SketchUp versions, allows you to access all of the additional Ruby's methods.
        Luckily there are XML ones...
        You just need to 'require' them in your code - because, although they ship with the newer SketchUp, they don't auto-load...
        You need to do some Ruby API learning, above-and-beyond the SketchUp API...

        You can even load/require additional 'gems' - i.e. those which are not shipped with SketchUp... but in this case, I don't think you'll need to do that πŸ˜‰

        TIG

        1 Reply Last reply Reply Quote 0
        • M Offline
          MaryamR
          last edited by

          Yeah i do need to do some Ruby API learning it's just that i want is it possible to export data in an xml file.
          and i did find something about the "require" part but do i need to add some files from Nokogiri, REXML or Builder to the sketchup folder ?

          i'm using sketchup Make 2014

          1 Reply Last reply Reply Quote 0
          • TIGT Offline
            TIG Moderator
            last edited by

            Please adjust your profile details...

            C:\Program Files (x86)\SketchUp\SketchUp 2014\Tools\RubyStdLib\xmlrpc

            is a collection of XML tools...
            Read up and see if they'll do what you want.
            There are many Ruby utilities in that file,
            You can use additional Ruby files [like Nokogiri], but it's just another layer of complication you could perhaps sidestep...
            Do add things to the SketchUp Ruby folder - do it in another way...
            There is specific AppData location for 'gems'...

            TIG

            1 Reply Last reply Reply Quote 0
            • M Offline
              MaryamR
              last edited by

              Thank you for your answer i did adjust my profile, and it's my first time using sketchup and sketchup ruby api and i'm supposed to deliver a projet using those two and i searched so much randomly as i didn't know the exact methode to search about

              1 Reply Last reply Reply Quote 0
              • 1 / 1
              • First post
                Last post
              Buy SketchPlus
              Buy SUbD
              Buy WrapR
              Buy eBook
              Buy Modelur
              Buy Vertex Tools
              Buy SketchCuisine
              Buy FormFonts

              Advertisement