sketchucation logo sketchucation
    • Login
    πŸ›£οΈ Road Profile Builder | Generate roads, curbs and pavements easily Download

    [Plugin] Uniquify v1.0 20130215

    Scheduled Pinned Locked Moved Plugins
    12 Posts 8 Posters 13.9k Views 8 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.
    • M Offline
      matt.gordon320
      last edited by

      Thanks TIG! Great tool!

      1 Reply Last reply Reply Quote 0
      • C Offline
        cesaro36
        last edited by

        Hi TIG thanks for the plugin
        One question
        If a component "B" is contained several times inside a component "A". Is possible that after "uniquifying" the component "A" all sub-components named "B" remain the same but unified instance?
        Example: inside "A", "B" turn into "B#1" "B#1" "B#1" etc instead of "B#1" "B#2" "B#3" ...

        Thanks

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

          It makes ALL instances of everything unique.

          TIG

          1 Reply Last reply Reply Quote 0
          • F Offline
            Filberts
            last edited by

            @tig said:

            It makes ALL instances of everything unique.

            Is it possible to edit it? I just want plugin that recognise if some detail is connected and gives to it differiend name depending on connection and how many connections. Can anybody help, please?

            1 Reply Last reply Reply Quote 0
            • C Offline
              crazykoala
              last edited by

              Hi, first of all, thanks for the plugin, it works great. That's awesome work.
              However, -I know I'm just about to be a real pain, sorry about that-, I was wondering if there was any chance to edit the plugin code so that once you have created, copied and "uniquified" your components, the first item/column of items/line of items will be the one closest to the origin, whereas the farthest would be the last?
              the aim is to get evocative definition names

              For instance, the highest shelf of the second shelves in the aisle could be named 2#1, and the shelf below 2#2.

              I'm trying to model a library and particularly its many identical storage areas. With this, I want to link the library database with sketchup so that when I search for a book on a terminal, sketchup highlights its location on the plan.

              ...that's about it...

              1 Reply Last reply Reply Quote 0
              • KrisidiousK Offline
                Krisidious
                last edited by

                Thanks Tig.

                By: Kristoff Rand
                Home DesignerUnique House Plans

                1 Reply Last reply Reply Quote 0
                • K Offline
                  KrisM
                  last edited by

                  TIG,

                  First of all, thanks for your overwhelming number of contributions to the SketchUp community.This is certainly far beyond simply helping out and is greatly appreciated.
                  With regard to this plugin, I am in need of (like Cesoro63 above)of a plugin which preserves the components in the containing component making the the nested component unique but not all instances unique. This is the workflow that I almost always need rather than creating separate components of everything. I have looked for a plugin like this but no luck so far.
                  Any ideas?
                  Kris

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

                    How about a simple one-liner pasted into the Ruby Console + <enter>, which works on all pre-selected component-instances [selection can contain other entity types but they are ignored], it then makes them all unique where appropriate, but leaving all of their contents intact and unchanged...

                    m=Sketchup.active_model;s=m.selection;c=s.grep(Sketchup;;ComponentInstance);s.clear;s.add(c);m.start_operation('x');c.each{|i|i.make_unique if i.definition.instances[1]};m.commit_operation;
                    

                    You'll end up with the selection now only containing component-instances and each of those is unique [xxx#1 etc] -if there is only one instance of that definition it keeps its name [xxx]. It is one step un-doable...

                    To make any one-liner into a menu activated 'plugin'... do something like this...
                    Make a copy of any existing script [ .rb]
                    Name the file xxx.rb where ' xxx' reflects what it does...
                    Empty the file [this way you'll ensure that its 'UTF8 without BOM'].
                    Paste in the following:

                    require('sketchup.rb')
                    module KrisM
                      unless file_loaded?(__FILE__)
                        IUI.menu.add_item('My xxx'){self.xxx()}
                      end
                      file_loaded(__FILE__)
                      def self.xxx()
                        ###xxxxxxx###
                      end#method
                    end#module
                    

                    Choose your own module name [here it's ' KrisM'], tool name [here it's ' xxx'], menu location/name [here it's ' Plugins' & ' My xxx'] etc...
                    Replace the '###xxxxxxx###' with all of the one-liner's code.
                    For ease in reading the code later may I suggest that you add newlines in place of the one-liner's ' ;' [note how these are used to mimic the needed newlines between the code's various parts when you are typing in a continuous string]...
                    You can add 'comments' [usually at the top] of any script within a =begin ... =end block or just use # in front of every line - these lines are then ignored as the code is loaded, but remain useful for reminding you what the script does etc when you re-read it months later...
                    It's also recommended that you get and use a good plain-text editor like Notepad++ [PC] or TextWrangler [MAC] as these will have helpful syntax highlighting, line-numbering etc, which is not available with the basic Notepad.exe etc - and they are free πŸ˜„

                    TIG

                    1 Reply Last reply Reply Quote 0
                    • K Offline
                      KrisM
                      last edited by

                      TIG,

                      Thanks for your reply. Unfortunately, the ruby script doesn't do what I am after. It still creates individual components, not linked together components. I am not explaining my needs very well.

                      What I am after -
                      -Make a copy of Comp A
                      -Rename copy to Comp B
                      -Rename nested components in B to something different than the names in Comp A but retaining the relationship of the nested components in Comp B

                      I can do this manually -
                      -Copy Comp A
                      -Make unique the copy
                      -Select all the instances of a particular component within the copy and make them unique
                      This works but is slow if you are doing this to twenty copies for example.

                      Any ideas?

                      Kris


                      Component Copy Example.jpg

                      1 Reply Last reply Reply Quote 0
                      • K Offline
                        KrisM
                        last edited by

                        Okay, solved my own problem -
                        -Copy Comp A
                        -Make copy unique, rename as appropriate
                        -Open copy and select all nested components
                        -Make unique
                        This preserves all relationships and renames all the components without having to select each group of components individually.
                        Minimum number of clicks.
                        A plugin would save me a couple of clicks but I can live with this.

                        Kris

                        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