sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    Selection of Dynamic component using ruby

    Scheduled Pinned Locked Moved Dynamic Components
    sketchup
    5 Posts 4 Posters 722 Views 4 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.
    • B Offline
      blue_orchid
      last edited by

      **I need to know how to select the existing dynamic component using ruby.

      Is it same as selection of component?

      Thanks!**

      1 Reply Last reply Reply Quote 0
      • thomthomT Offline
        thomthom
        last edited by

        Can you be more specific?

        Yes, selecting a DC is the same as a normal component, because a DC is a component with some attributes.

        But what do you mean by "select the existing dynamic component"?

        Thomas Thomassen — SketchUp Monkey & Coding addict
        List of my plugins and link to the CookieWare fund

        1 Reply Last reply Reply Quote 0
        • B Offline
          blue_orchid
          last edited by

          I just meant that dynamic components have been created in sketchup itself but not with ruby script.

          Can you write the script to select a single DC?

          Thanks for your help!

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

            An instance of a DC is an entity like most other things in the API.
            Once you get a reference to it you can use that to do things to i; or you could clear the current model.selection and add the DC_instance to it using the reference you have got earlier.
            How you you expect to 'find' the DC to 'select' it ?

            TIG

            1 Reply Last reply Reply Quote 0
            • Chris FullmerC Offline
              Chris Fullmer
              last edited by

              If you are trying to figure out how to determine if a component is dynamic or not, then like Thom suggested - it is just a regular component with special libraries attached to it. So you would iterate through all the component definitions in the model and find the ones that have the dynamic component attribute library. Then you would select all of their instances, or you would need some other criteria to determine which single instance you want.

              Do you know how you are planning on singling out the specific instance you want to select?

              Lately you've been tan, suspicious for the winter.
              All my Plugins I've written

              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