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.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better đź’—
Register LoginAdvertisement