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

    Ruby request: Redraw function for multiple selected DCs ..

    Scheduled Pinned Locked Moved Developers' Forum
    4 Posts 2 Posters 594 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.
    • D Offline
      ddcddc
      last edited by

      Hi all,

      Here is one little request for those ruby masters out there:

      Can someone come up with a good way to achieve the "redraw" function for multiple selected dynamic components?

      Any ideas would be greatly appreciated..

      cheers!
      ddcddc

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

        Looks like this sample code redraws a DC. You can modify that to iterate over multiple.
        http://forums.sketchucation.com/viewtopic.php?f=180&t=17888&p=145437&hilit=+dynamic+component+#p145120

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

        1 Reply Last reply Reply Quote 0
        • D Offline
          ddcddc
          last edited by

          @thomthom said:

          Looks like this sample code redraws a DC. You can modify that to iterate over multiple.
          http://forums.sketchucation.com/viewtopic.php?f=180&t=17888&p=145437&hilit=+dynamic+component+#p145120

          Thanks for the info thomthom πŸ‘

          Excuse my noobness, but it seems to me that

          $dc_observers.get_latest_class.redraw_with_undo(Sketchup.active_model.entities[0])

          is only gonna work for the first and the only first component that I chose to "redraw" by using this script.

          I am no where near a good ruby script writer, would u mind pointing me to a clearer way of doing this ?

          Cheers!

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

            The way I read it was that $dc_observers.get_latest_class would return the latest observer for the model.

            And that you can feed .redraw_with_undo(...) with the DC's you want.

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

            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