Group.make_unique (possible Ruby bug)
-
I have an odd situation where I need to make sure that a group's component definition has only one instance (i.e. is unique).
I notice that the group.make_unique method is deprecated but it still works. However, I get a warning message every time it is called.
The problem arises when a user copies a group, thus creating another instances of the group's definition. Then, let's say my Ruby script attempts to erase all the edges in the currently selected group. Instead of just erasing the edges in the selected group, all instances of the group are affected which is not what I want. This seems like a bug with the Ruby API. In my mind, if you do any manipulation to a group's entities using Ruby code, the group should automatically be 'made unique' by SketchUp (just like what happens when you enter group edit mode by double-clicking a group).
My question is:
Is it possible to make a group unique without using the group.make_unique method (using Ruby)? -
I am afraid it is a ruby bug. SU2KT users has reported similar behaviour of groups. SU sometimes treats them as instances! I am not aware of a different method to make group unique ?
Add it to RubyAPI wish list, please. I mean a bugfix
Tomasz
-
A Group is a single Instance of a Definition - and of course there should only ever be one of them, but sometimes SUp with Ruby thinks that a copy of a Group is another Instances. The way round it in Ruby is to use make_unique on the copy of the group (instance) as you go. It will return an error but it should work anyway... It might get fixed one day...
Advertisement