Copy array (again)
-
Hi!
I have had this subject mentioned before and some similar topic have recently been brought up.
http://forums.sketchucation.com/viewtopic.php?f=180&t=38413&p=339504&hilit=copy+groups#p339504However having some problems with above method and erasing groups, after they have served their purpose.
Using this code seams safer, but translation is off. It translates the whole new group 1ve. Instead it should translate each subgroup 1ve What am I doing wrong?
My guess is that the instance is "inserted" each time at gp1tran and moved with ve from there each time, but how do I transfer the insertion to the next spot each insertion?
This resulting group of groups(gp2) should be copied and translated again, and I get splats erasing gp2 afterwards using standard group.copy methods..
#gp1=group1 gp2=group2 cop_times=number of copies rents =group2.entities gp1ents=gp1.parent.entities; gp1defn=gp1.entities.parent; gp1tran=gp1.transformation # cop_times.to_i.times{|i| tgp=rents.add_instance(gp1defn, gp1tran) #using ve for transformation=no good tgp.transform!(Geom;;Transformation.translation(ve)) }
-
You need to increment the transformation vector too ?... and remake the translation each time you place an instance...
-
Aha. That sounds pretty obvious when you say it.
See if I got it right...
Let say the vector originaly has a length of 10. Then for each copy the vector.length increases with +10?
Ok. then I will have to reset the vector to 10 before doing the second group, unless using a vector.clone.Thanks TIG.
-
@jolran said:
Thanks TIG.
Hey look! It's a bird... no, it's a plane? .. no wait.. It's SketchupMan !!!!!!
-
Ok..................
Advertisement