What I actually did was renamed the
@group1 reference in your code snippet to
context but one step UP from what TIG described. Perhaps it should be named
object instead, but it cannot be just any object class. It has to
respond_to? method calls
container would be a better name ?
I just realized I may have “outsmarted” myself. I thought at the last minute that you could possibly pass in either: a group, a component or the model proper.
BUT, now I see that this will not work as written. Ie, a call to
model.model would produce a
NoMethodError, as well as if you passed in a ComponentInstance (the
entities call needs to be made on it’s definition.)
So really TIG has the right of it.
The method’s arg should be any of his listed 4 entities collections …
and the 1st line should change from …
edge_list = context.entities.grep(Sketchup::Edge)
… to …
edge_list = context.grep(Sketchup::Edge)
I’ll change the above snippet for future readers and add TIG’s list as method params.
And also changed the
erase_entities line (in the operation) to remove
.entities call as it is now (as always should have been,) an
… is now …