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

Dynamic Component Value Reference Model Attribute Value

Scheduled Pinned Locked Moved Dynamic Components
sketchup
4 Posts 2 Posters 6.2k 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.
  • S Offline
    Skastafari
    last edited by 13 May 2019, 18:29

    Is this something that can be done? I have found myself in a situation where having a dynamic component value reference a model attribute value would be very beneficial; though I am not sure how, or if it can be done. If this can be done, can someone provide me with a working dynamic component syntax example. If this is not possible, I suppose I could accept the sad news instead.

    1 Reply Last reply Reply Quote 0
    • P Offline
      pcmoor
      last edited by 14 May 2019, 07:02

      You can reference any component or group by name if they are on the same level of nesting. So objects in the same file can reference attributes via the DC dialog; however you need to do a redraw for this to take effect. Redraw can be done via the DC, right click menu or a ruby script.
      You can reference the parent by name or by by the generic term parent as in parent!attribute rather than just myDC!attribute, this makes generic referencing possible for inserted DCs.
      Parent attributes of a file are not available on opening, so to create an environment that can have global attributes the file would retain a DC which would be opened to insert components that can update to the global data.

      1 Reply Last reply Reply Quote 0
      • S Offline
        Skastafari
        last edited by 14 May 2019, 21:07

        So, I get how to use parent as a variable way to reference the next level up in a component hierarchy, except it seems to fail (or I fail?) at the top component level, leaving no way to reference anything outside the component hierarchy. If I understand what you are saying correctly... to get a sort of "global" reference in a dynamic component, one must first place it in another component and work in that component. I guess I just figured the "right" way to have a hierarchy is to have a top level (being the model itself) and referencing model attributes vs component attributes at that point. This would seem to be the logical way to organize things to me. Though my attempts to produce any results in this way have all failed. Am I wrong in my understanding here?

        1 Reply Last reply Reply Quote 0
        • P Offline
          pcmoor
          last edited by 15 May 2019, 09:20

          To update references on change of a global, one needs to do a "redraw" as per the context menu for each component, rather than do this manually, a simple ruby script can be attached to a button as per

          Link Preview Image
          Redraw all dynamic components?

          Is anyone aware of a way to redraw a group of components or the entire model in one shot? I am finding that individually selecting and right clicking to redraw is tedious and it’s easy to miss a component in large model…

          favicon

          SketchUp Community (forums.sketchup.com)

          Link Preview Image
          SketchUp Plugins | PluginStore | SketchUcation

          SketchUp Plugin and Extension Store by SketchUcation provides free downloads of hundreds of SketchUp extensions and plugins

          favicon

          (sketchucation.com)

          where else a component instance will update to the current global on insert.

          Can you share the main focus of your use of DCs? as its quite likely other scripts will be useful.

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

          Advertisement