• Login
sketchucation logo sketchucation
  • Login
🔌 Quick Selection | Try Didier Bur's reworked classic extension that supercharges selections in SketchUp Download

Dynamic Components and Glue To

Scheduled Pinned Locked Moved Developers' Forum
6 Posts 2 Posters 555 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.
  • K Offline
    kwalkerman
    last edited by 24 Jun 2010, 20:53

    I'm not sure if this is the best forum for this, but I'll give it a try...

    Does anyone know of a way to have simple dynamic component pull information from it's "glued_to" surface. I think this may really be part of a larger question, which is how to go beyond simple spreadsheet-like formulas in dynamic components to something really useful.

    I can think of a way to do this if I can create a number in a ruby file, and then send it to the DC. I have followed the advice from Scott Lininger's post (http://forums.sketchucation.com/viewtopic.php?f=180&t=24241 ) regarding creating dynamic components in ruby. First, no mater what I enter for units, the dynamic component units are the default text. Second, once I have created the variable, if I change the units in the DC attributes editor, I can't change it using ruby code by simply saying x.set_attribute.

    Any ideas?

    Thanks,

    --
    Karen

    1 Reply Last reply Reply Quote 0
    • D Offline
      Dan Rathbun
      last edited by 25 Jun 2010, 08:36

      @kwalkerman said:

      Does anyone know of a way to have simple dynamic component pull information from it's "glued_to" surface.

      Yes it's the correct forum.

      @unknownuser said:

      (http://code.google.com/apis/sketchup/docs/ourdoc/componentinstance.html#glued_to )":257d4pve]The glued_to method is used to retrieve the entity that this instance is glued to.

      So once you have the 'gluee' entity reference, you'd use that object's methods to gain information, likely starting with gluee.class which should probably be a Sketchup::Face.

      I'm not here much anymore.

      1 Reply Last reply Reply Quote 0
      • D Offline
        Dan Rathbun
        last edited by 25 Jun 2010, 08:55

        If your asking about automation... we have a problem at present.

        Both the DefinitionObserver and InstanceObserver classes are bugged.

        You should monitor ThomThom's topic "State of Observers"
        http://forums.sketchucation.com/viewtopic.php?f=180&t=20676 (bookmark it..)

        Once the DefinitionObserver is fixed, you could then implement an onGlue method, that could update attributes in a component's dictionary.

        Right now you'd have to use some other working Observer to fire a polling type method, that iterates Instances, and checks their glued_to value. Then do whatever, depending on the value, or if it changed (which means YOU would have to keep a Hash of "glued to object" values for Instances of interest.)

        I'm not here much anymore.

        1 Reply Last reply Reply Quote 0
        • K Offline
          kwalkerman
          last edited by 25 Jun 2010, 12:44

          Dan,

          I have been watching ThomThom's "state of observers" forum. And (assuming all observers are working correctly), I can think of some ways to use observers to 'watch' entities and feed information back to a ruby script, which does some calculations. The real problem is in the DC interface. I was hoping that someone here knew an unpublished way to access information about components that we can get using ruby code, directly in the DC interface.

          --
          Karen

          1 Reply Last reply Reply Quote 0
          • D Offline
            Dan Rathbun
            last edited by 25 Jun 2010, 15:03

            @kwalkerman said:

            The real problem is in the DC interface.

            Your not the first to have wishes of a custom DC Manager dialog.

            @kwalkerman said:

            I was hoping that someone here knew an unpublished way to access information about components that we can get using ruby code, directly in the DC interface.

            I've also seen others suggest embedded Ruby macros, inside a DC.

            I'll put this subject on my list of many things to look into. (I have considered a DC Tech Reference as a possible project, as the API does not cover them.)

            I'm not here much anymore.

            1 Reply Last reply Reply Quote 0
            • K Offline
              kwalkerman
              last edited by 28 Jun 2010, 13:55

              A DC tech reference would be pretty awesome. Thanks!

              --
              Karen

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

              Advertisement