• Login
sketchucation logo sketchucation
  • Login
Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
⚠️ Important | Libfredo 15.6b introduces important bugfixes for Fredo's Extensions Update

Set new value of Dynamic Component Attribute and recalculate

Scheduled Pinned Locked Moved Developers' Forum
3 Posts 3 Posters 440 Views 3 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.
  • T Offline
    tictactoe
    last edited by 19 Apr 2010, 12:22

    I want to modify the value of a dynamic component not via property dialog but by ruby code.
    How can do that and enforce afterwards a recalculation of the component instances?

    Eg.: The Component makes the attribute 'copies' user-changeable. I want to define this value and the component should rebuild the instances.

    1 Reply Last reply Reply Quote 0
    • A Offline
      adebeo
      last edited by 13 Oct 2011, 12:49

      Same problem ! Same answer ?

      adebeo
      Nos Formations sketchup
      Notre blog : www .adebeo.com/wp/
      Nos tutoriels: www .youtube.com/adebeo

      1 Reply Last reply Reply Quote 0
      • T Offline
        TIG Moderator
        last edited by 13 Oct 2011, 13:55

        You change [or add] the appropriate attribute[s] for the dynamic_component and then force it to refresh thus...
        assuming the dynamic_componentis referenced by 'dc' and you know the 'key'/'value' wanted...
        dc.definition.set_attribute("dynamic_attributes", 'key', 'value') $dc_observers.get_latest_class.redraw_with_undo(dc)
        🤓

        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