[Plugin] Uniquify v1.0 20130215

[Plugin] Uniquify v1.0 20130215

Postby TIG » Fri Feb 15, 2013 11:57 am

(c) TIG 2013
All rights reserved.
THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES;
INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE.
Usage: in code TIG::Uniquify.new() on a Selection.
OR use Plugins/Context-menu item 'Uniquify'...
All selected groups/components, and any nested groups/components are
made-unique.
It is one step undoable.
Donations:

Version:
1.0 20130215 First Release.
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] Uniquify v1.0 20130215

Postby Rich O Brien » Fri Feb 15, 2013 12:02 pm

'Uni-Quif'

similar to Uni-Brow? ;)

Nice tool
0
There's a frontroom and a backroom....reverse faces
User avatar
Rich O Brien 
Administrator
 

Re: [Plugin] Uniquify v1.0 20130215

Postby matt.gordon320 » Fri Feb 22, 2013 9:02 pm

Thanks TIG! Great tool!
0

matt.gordon320 
Premium Member
Premium Member
 

Re: [Plugin] Uniquify v1.0 20130215

Postby cesaro36 » Tue Mar 19, 2013 7:37 pm

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
0

cesaro36 
Premium Member
Premium Member
 

Re: [Plugin] Uniquify v1.0 20130215

Postby TIG » Tue Mar 19, 2013 10:35 pm

It makes ALL instances of everything unique.
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] Uniquify v1.0 20130215

Postby Filberts » Wed Mar 20, 2013 11:19 am

TIG wrote: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?
0

Filberts 
 

Re: [Plugin] Uniquify v1.0 20130215

Postby crazykoala » Wed Jul 31, 2013 7:38 pm

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...
0

crazykoala 
 

Re: [Plugin] Uniquify v1.0 20130215

Postby Krisidious » Wed Jul 31, 2013 9:36 pm

Thanks Tig.
0
By: Kristoff Rand
Home Designer
Unique House Plans
User avatar
Krisidious 
 

Re: [Plugin] Uniquify v1.0 20130215

Postby KrisM » Mon Nov 18, 2013 8:29 pm

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
0

KrisM 
Premium Member
Premium Member
 

Re: [Plugin] Uniquify v1.0 20130215

Postby TIG » Tue Nov 19, 2013 10:42 am

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...
Code: Select all
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:
Code: Select all
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 :D
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] Uniquify v1.0 20130215

Postby KrisM » Tue Nov 19, 2013 6:38 pm

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
0

KrisM 
Premium Member
Premium Member
 

Re: [Plugin] Uniquify v1.0 20130215

Postby KrisM » Tue Nov 19, 2013 10:29 pm

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
0

KrisM 
Premium Member
Premium Member
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 



 

Return to Plugins

Who is online

Users browsing this forum: sjiine and 11 guests

Visit our sponsors: