sketchucation logo sketchucation
    • Login
    ℹ️ GoFundMe | Our friend Gus Robatto needs some help in a challenging time Learn More

    Sketchup and Ruby

    Scheduled Pinned Locked Moved Developers' Forum
    3 Posts 2 Posters 540 Views
    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.
    • A Offline
      AuburnBIMer
      last edited by

      Is it possible to create a ruby script that is able to connect to a server in order to read data which will be used to move objects to a certain position in a sketchup model? If so, is there any help you can give me? Thanks!

      1 Reply Last reply Reply Quote 0
      • J Offline
        Jim
        last edited by

        Hi Allison,

        Possible, yes. The amount of time and effort involved will depend largely on your familiarity with programming (specifically Ruby, HTML and JavaScript) and the SketchUp Ruby API.

        Moving Groups and ComponentInstances in SketchUp is fairly straight forward. Moving "loose" geometry is slightly more complicated, but manageable. Moving is most easily done using a Transformation.

        The connection to a server can be done using a WebDialog. You may be able to use the WebDialog#post_url method to send data to a server. The result would be a string which would replace the current contents of the WebDialog. Alternatively, you could use XMLHttpRequest in a WebDialog to retrieve data from a server, in which case the response would be just the data.

        Once the data is retrieved by the WebDialog, it needs to be accessed by the Ruby part of the plugin, typically using WebDialog#get_element_value.

        Sorry for being short on details, but hopefully this overview helps narrow the scope a little. Please ask if you more specific questions - there are many people willing to help here, the official group, and there's even an irc channel for live #sketchup-dev.

        Hi

        1 Reply Last reply Reply Quote 0
        • A Offline
          AuburnBIMer
          last edited by

          Thank you very much for your reply. Unfortunately, I do not have a lot of experience with this kind of stuff so I might need some more guidance 😄

          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