sketchucation logo sketchucation
    • Login
    🤑 SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    Best Practice for Altering Project Components w/ Ruby API

    Scheduled Pinned Locked Moved SketchUp Discussions
    sketchup
    4 Posts 2 Posters 201 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.
    • L Offline
      lfpaul
      last edited by

      I am working on building a custom plugin for use inside SketchUp using the Ruby API. A WebDialog is used to display information that is pulled from the model (Such as scenes, materials, grids, etc). I am able to correctly display the desired information, however I want to be able to change/upadte this information from within the WebDialog and have it update in the SketchUp project.

      Ex) Inside the WebDialog all of the scenes in the project are listed. I want to be able to update the name of a scene, or delete a scene from within this dialog. So say I change the name of a scene from within the dialog, I want the dialog scene list and SketchUp project to update with the new name of the scene that was specified.

      What is the best practice for achieving this type of communication between a WebDialog and SketchUp using the Ruby API?

      I am fairly new to this SketchUp Ruby API and would appreciate any other tips or general advice about using it to manipulate project properties and components.

      Thanks in advance!

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

        Callbacks ?

        TIG

        1 Reply Last reply Reply Quote 0
        • L Offline
          lfpaul
          last edited by

          @tig said:

          Callbacks ?

          Makes sense. Could you provide some example code by chance?

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

            Read the WebDialog pages in the API...

            There are also many freely available scripts in the PluginStore etc, using WebDialogs, where you can read the RB, HTML and JS etc, to see the 'callback' code format...

            TIG

            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