[REQ] find similar groups and create components
-
2.6 is his latest, but it's not specifically needed for the plugin. - http://forums.sketchucation.com/viewtopic.php?t=30503
However, like you, on my end the plugin itself seemed broken for a while.. If I remember I re-downloaded and re-installed all of my plugins from Thomas and it seemed to fix the issue. Can't say what it was specifically. If it is working properly, when you run the script with nothing selected you should receive a warning that says "Analyzing all definitions in a model can take a long time. Are you sure you want to continue?"
-
I re-installed again and did everything correctly even got the warning and clicked okay and nothing happened.
I dunno what's up.
-
I'm assumming that the groups don't have names and must be compared entity by entity?
-
I believe you are right, they are all grouped as per import from Deep exploration which I used to convert the .stp to .skp.
-
Solo, could you try this:
#1 make one of the similar groups a component ( explode the group before )
#2 select the component
#3 run Similar objects/ Replace Similar Objects.All similar groups become instances of the component.
-
Solo, I hate to rain on your parade but creating a group and copying it 99 times versus placing 100 instances of that group converted into a component actually increased the filesize.
-
@sdmitch said:
Solo, I hate to rain on your parade but creating a group and copying it 99 times versus placing 100 instances of that group converted into a component actually increased the filesize.
What I want is to make it faster to navigate in SU, so making it a component and then the other 99 of the same mesh as a instance of that component would make it lighter in SU.
-
@gilles said:
Solo, could you try this:
#1 make one of the similar groups a component ( explode the group before )
#2 select the component
#3 run Similar objects/ Replace Similar Objects.All similar groups become instances of the component.
I tried that to no avail, nothing happened.
-
This is the ruby consol report:
Replacing Similar Objects... Error; #<NoMethodError; undefined method `definition=' for #<Sketchup;;Group;0x148c1b6c>> C;/PROGRA~2/Google/GOOGLE~1/Plugins/tt_cc.rb;139;in `replace' C;/PROGRA~2/Google/GOOGLE~1/Plugins/tt_cc.rb;137;in `each' C;/PROGRA~2/Google/GOOGLE~1/Plugins/tt_cc.rb;137;in `replace' C;/PROGRA~2/Google/GOOGLE~1/Plugins/tt_cc.rb;119;in `each' C;/PROGRA~2/Google/GOOGLE~1/Plugins/tt_cc.rb;119;in `replace' C;/PROGRA~2/Google/GOOGLE~1/Plugins/tt_cc.rb;33 C;/PROGRA~2/Google/GOOGLE~1/Plugins/tt_cc.rb;139;in `call' C;/PROGRA~2/Google/GOOGLE~1/Plugins/tt_cc.rb;139
-
I believe that is because only components have definitions.
-
You should report to Thomthom.
Could you post a model? -
-
Could you isolate some groups in a separate model to give it a try?
-
@sdmitch said:
I believe that is because only components have definitions.
Components, Groups AND Images ALL have "definitions".
However, unlike "instance.definition" there is NO API "group.definition" method [OR indeed "image.definition"] UNLESS it has been added by additional code within a script to make the method - so therefore this suggests 'something is missing', because TT WOULD have included for this somewhere in his coding... ?
So... do you have all of the support files installed properly [needed TT Libs etc] ?: -
It seems that TT Libs aren't request for this one.
-
That may be... but 'group.definition' does need to be created somewhere...
PM TT... -
Okay, I downloaded the window model from the thread where the plugin exists and ran the test and it worked exactly as it should, so this means my instalation and all needed files are in order.
I then created a new scene and made a cube, grouped it and created 20 instances of it then ran the script which did nothing....is it me not understanding what this script should do or is something funny going on?
-
@unknownuser said:
I then created a new scene and made a cube, grouped it and created 20 instances of it then ran the script which did nothing....is it me not understanding what this script should do or is something funny going on
If you make on them different ( explode then group or better make component ) it should work.
if you have 1 group + 20 instances of it they all have the same definition, so there is nothing to change.
.... I think; -
Take this example, I have 8 tubes (grey) and 16 rings (red) they are all groups, what I'd like to happen is for a script to see that there are 8 identical tubes and 16 identical rings and it then makes a component from one of the tubes, delete or changes the others to be an instance of the first component, same for rings.
-
Pete,
Have you tried Convert in Single Components from Component/Group Tools http://forums.sketchucation.com/viewtopic.php?f=180&t=17590&start=0&st=0&sk=t&sd=a? This converts everything in the selection set into a component. Sometimes it doesn't work, but rerun and if it's successful a dialog will appear.Then run Component Comparison by Thom Thom and it should replace everything that is identical. CC only works on components, hence the first step. If any geometry was skewed in the import process, then it probably won't replace them, but it might help cut down on the # of entities you have to deal with.
Advertisement