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

    Explode each DC sub-group and re-group

    Scheduled Pinned Locked Moved Plugins
    5 Posts 4 Posters 3.9k Views 4 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.
    • gullfoG Offline
      gullfo
      last edited by

      i was wondering how to take a dynamic component and convert it into a static component. basically if after adjusting the parameters it was possible to explode each sub-group or sub-component and re-group it or re-componentize it with the same name as it originally had, if that would do the trick. if this script could also perform this on all DC at once or within the same family or selection, would be ideal. the sharing models with a lot of DC which are converted to static units (preferably losing all the calculations etc - purged?) would be nice to reduce size and or protect proprietary components.

      Glenn

      http://www.runnel.com

      1 Reply Last reply Reply Quote 0
      • TIGT Offline
        TIG Moderator
        last edited by

        All you need to do is remove the SKP's dc definitions'/instances' attribute dictionary named 'dynamic_attributes'.
        Something long these lines, to unDC ALL in the SKP...

        m=Sketchup.active_model;m.start_operation("unDC");m.definitions.each{|d|d.attribute_dictionaries.delete("dynamic_attributes") if d.attribute_dictionaries and d.attribute_dictionaries["dynamic_attributes"];d.instances.each{|i|i.attribute_dictionaries.delete("dynamic_attributes") if i.attribute_dictionaries and i.attribute_dictionaries["dynamic_attributes"]}};m.commit_operation
        

        Copy/Paste the one-liner into the Ruby Console. Warning it destroys all DC-ness, only use if you are really sure !! BUT it is one-step undo-able... 🤓

        TIG

        1 Reply Last reply Reply Quote 0
        • gullfoG Offline
          gullfo
          last edited by

          thanks! very cool. i didn't realize there was a set of attributes which could simply be stripped. it works really well - pretty much instantly on a fairly complex DC. definitely a last step in the process... 👍

          Glenn

          http://www.runnel.com

          1 Reply Last reply Reply Quote 0
          • TNTDAVIDT Offline
            TNTDAVID
            last edited by

            Wonderful !

            The code works fine. 👍

            How to create an icon that activates this code?

            To delete all the attributes of a dynamic component, you can also save your file as SKP6 format. 😉

            Thank you for your help.

            Cordially

            David Barros

            [b:8wt9py2i]* Nouveau !!![/b:8wt9py2i] Découvrez notre nouveau Plugin [url=http://www.composant-dynamique.com/:8wt9py2i][color=#40FF00:8wt9py2i]C[/color:8wt9py2i][color=#77FF00:8wt9py2i]l[/color:8wt9py2i][color=#ADFF00:8wt9py2i]i[/color:8wt9py2i][color=#E4FF00:8wt9py2i]c[/color:8wt9py2i][color=#FFDB09:8wt9py2i]k[/color:8wt9py2i][color=#FF921B:8wt9py2i]-[/color:8wt9py2i][color=#FF492E:8wt9py2i]C[/color:8wt9py2i][color=#FF0040:8wt9py2i]u[/color:8wt9py2i][color=#ED2577:8wt9py2i]i[/color:8wt9py2i][color=#DA49AD:8wt9py2i]s[/color:8wt9py2i][color=#C86EE4:8wt9py2i]i[/color:8wt9py2i][color=#AD77FF:8wt9py2i]n[/color:8wt9py2i][color=#8965FF:8wt9py2i]e[/color:8wt9py2i] [color=#4040FF:8wt9py2i]2[/color:8wt9py2i][/url:8wt9py2i], pour créer vos cuisines 3D !

            1 Reply Last reply Reply Quote 0
            • R Offline
              RubenRomeroVivancos
              last edited by

              it does not work in the ruby command, not sure why, I do not see any changes in sketchup 2020. I got groups with nested groups at one level and I am trying to explode all nested groups and leave a single group level

              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