• Login
sketchucation logo sketchucation
  • Login
๐Ÿค‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

Plugin to make all components in model unique?

Scheduled Pinned Locked Moved Plugins
6 Posts 4 Posters 484 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.
  • D Offline
    danbig
    last edited by 13 Oct 2010, 01:03

    Hi -

    Is there a plugin that will make all components unique?

    I"m not looking for a fix where I have two different components that share the same name, but I'm looking for something that will make all instances of the same component unique.

    1 Reply Last reply Reply Quote 0
    • C Offline
      Chris Fullmer
      last edited by 13 Oct 2010, 01:46

      Hmm, I cant think of one off the top of my head.

      It would be a great script for someone to write who is trying to learn ruby....'eh Dan?? ๐Ÿ˜„

      Lately you've been tan, suspicious for the winter.
      All my Plugins I've written

      1 Reply Last reply Reply Quote 0
      • D Offline
        danbig
        last edited by 13 Oct 2010, 03:48

        @chris fullmer said:

        Hmm, I cant think of one off the top of my head.

        It would be a great script for someone to write who is trying to learn ruby....'eh Dan?? ๐Ÿ˜„

        Who? Me?

        Agreed. Haha. I'm still working on script #1, which hasn't progressed much for the last few months.

        Interestingly, Fredoscale has a utility built in that makes all selected instances of a component unique. TIG also posted a snippet that does the same, but I had a hard time getting it to work.

        1 Reply Last reply Reply Quote 0
        • M Offline
          mac1
          last edited by 13 Oct 2010, 04:05

          Check out make_components by Matthieu Noblet. It has a minor bug. You have to include a line in the selection

          1 Reply Last reply Reply Quote 0
          • H Offline
            honoluludesktop
            last edited by 13 Oct 2010, 20:22

            Place in plugin folder, open Ruby Console, and type alluinque [enter] in the command window:

            def allunique
              model = Sketchup.active_model
              entities = model.entities
              entities.each do |e|
                if e.is_a? Sketchup;;ComponentInstance
                   e.make_unique
                end
              end
            end
            
            1 Reply Last reply Reply Quote 0
            • D Offline
              danbig
              last edited by 14 Oct 2010, 16:22

              Hi Honolulu -

              Thanks a million for this script. This is exactly what I needed. It's nice that this isn't recursive, which fits the workflow nicely for what I'm using this for.

              I've edited the script slightly, to make it operate on just the selected components. (Chris, you'll be very proud...)

              Same instructions for use, but select the components you wish to make unique first, then type "allsunique" into the console and hit enter.

              def allsunique
                model = Sketchup.active_model
                selection = model.selection
                selection.each do |e|
                  if e.is_a? Sketchup;;ComponentInstance
                     e.make_unique
                  end
                end
              end
              
              1 Reply Last reply Reply Quote 0
              • 1 / 1
              1 / 1
              • First post
                1/6
                Last post
              Buy SketchPlus
              Buy SUbD
              Buy WrapR
              Buy eBook
              Buy Modelur
              Buy Vertex Tools
              Buy SketchCuisine
              Buy FormFonts

              Advertisement