Creating groups by


Why groups are created by:
instead of: ?


Fitstly, because they like ALL Sketchup::Entity subclasses, they are actually C++ objects that are merely exposed to Ruby. (So the normal Ruby constructor methods do not create valid objects on the C-side.)

ie …

g = Sketchup::Group::new
#=> false

Secondly, because like all Sketchup::Drawingelement subclasses, they need to be created within an entities collection context, and simply creating a “floating” reference using the Ruby ::new constructor will not do this.

… ie, the unowned group reference is not part of any model at this point, so you cannot even add entities too IT.


Thanks, Dan.


This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.