DC instance make unique
-
That's all very interesting, and probably quite important for us new to Sketchup Ruby to understand how groups and components works.
@unknownuser said:
If you compare the method lists, between Group and ComponentInstance, you'll see they have nearly the same methods.
The difference? A Group cannot be saved out to a file (directly) for use in other models, and it's easier to get at a ComponentInstance's definition, because there's an API method for it.I was wondering about behaviors? I noticed that if you have a face, draw a square on it and 3pl click to select. Then make a group out of that, it will behave like a cutting component onto that face. You can even unglue it if you rightclick.
However there is no "glue_to" method for groups in the API. -
@jolran said:
However there is no "glue_to" method for groups in the API.
Right.. and you should not use a
Group
, for the job of aComponentInstance
.Groups are best used for temporary editing both manual and in scripting.
By collecting objects together into a Group, you can:
- move them from one edit context to another,
- protect them from being modified by crossing edges,
- apply a tranform to a set of objects all at once (where they move, scale or rotate all together.)
I would say, that when you get a "set" of objects the way you want, and then wish to use that set multiple places in the model, it's best to then convert them into a
ComponentInstance
. Especially if your going use scripting, to manipulate them, or glue them to faces.
Advertisement