Hi guys,
@pascal and @stevebaer I presume
I see that if I use rs.CopyObjects() and select a group with objects to copy then the copies ends up in the same group as the initial objects. Is that by design? And how do I prevent it from happening?
Just make some 1x1x1 boxes and group them and try this:
import rhinoscriptsyntax as rs
rs.CopyObjects(rs.GetObjects("select objects to copy", filter=0, group=True), (10,0,0))
And see how the copied objects is in the same group.
I guess I could pull the copies from the group, make a new and put them in there, but it becomes more complex if there are nested groups, because then the copies ends up in those nested groups too.
My best workaround so far is using rs.Command(“_Copy…”) like this:
import rhinoscriptsyntax as rs
objs = rs.GetObjects("select objects to copy", filter=0, group=True)
if objs:
origin = rs.coerce3dpoint((0,0,0))
destination = rs.coerce3dpoint((10,0,0))
rs.SelectObjects(objs)
rs.Command("_Copy Pause w"+str(origin)+" w"+str(destination)+" NoEcho Enter",False)
But that is a long workaround and I try to stay away from rs.Command() as much as possible.