[REQ] find similar groups and create components
-
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.
-
Selection tools does it to.
http://forums.sketchucation.com/viewtopic.php?t=14975#p114380select groups
right click context menu/group copies/convert into component
If groups were copies you will have one component + n instances.
edit:
if groups are copies,right click context menu/group copies/select all
right click context menu/group copies/convert into component.
Advertisement