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

    Set new value of Dynamic Component Attribute and recalculate

    Scheduled Pinned Locked Moved Developers' Forum
    3 Posts 3 Posters 411 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

      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

        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
        • TIGT Offline
          TIG Moderator
          last edited by

          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