I haven’t posted much to the Ruby API board lately, primarily because I don’t usually need to, most of my code is fairly established and I usually can find a sample within my code to massage a little and reuse it.
However, today I’ve come upon a programming problem I don’t think I’ve encountered before.
First I’m creating two groups within my parent group:
I then create a group within “dooronlygroup1” that contains a bunch of geometry, I call this group “group1s”, I then copy it and mirror it, creating “group2s”:
My problem is that the mirrored group “group2s” is naturally within the “dooronlygroup1” and I want to somehow move it into the “dooronlygroup2”. Is there a way to do this?
I can probably figure this out or even come up with a clever work around if I muck around with it long enough (a couple of hours), but I figure I would ask here first instead of wasting my time and beating my head against a brick wall, like I usually do.
You could do it this way…
You have the definition of group1s.
Use add_instance on that in the dooronlygroup2.entities using the group1s.transformation - call it group2s.
Take that group2s instance and apply your mirroring transformation etc.
If necessary use make unique on the new group group2s, otherwise it’s linked as a copy of the original group group1s…
Many methods have two versions, one without and one with an exclamation point. The one without a ! returns a new, modified object. The one with a ! modifies the original object and also returns it. I suppose the person writing the API doc thought this was a well-known convention so didn’t feel a need to explain it.