• Login
sketchucation logo sketchucation
  • Login
โ„น๏ธ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

Copy array (again)

Scheduled Pinned Locked Moved Developers' Forum
5 Posts 3 Posters 146 Views 3 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    jolran
    last edited by 22 Aug 2011, 19:04

    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#p339504

    However 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))
    			   
    			} 
    			
    
    1 Reply Last reply Reply Quote 0
    • T Offline
      TIG Moderator
      last edited by 22 Aug 2011, 19:48

      You need to increment the transformation vector too ?... and remake the translation each time you place an instance...

      TIG

      1 Reply Last reply Reply Quote 0
      • J Offline
        jolran
        last edited by 22 Aug 2011, 20:11

        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.

        1 Reply Last reply Reply Quote 0
        • D Offline
          Dan Rathbun
          last edited by 22 Aug 2011, 20:53

          @jolran said:

          Thanks TIG.

          Hey look! It's a bird... no, it's a plane? .. no wait.. It's SketchupMan !!!!!!
          ๐Ÿ˜†

          I'm not here much anymore.

          1 Reply Last reply Reply Quote 0
          • J Offline
            jolran
            last edited by 22 Aug 2011, 22:29

            Ok.................. ๐Ÿ˜•

            1 Reply Last reply Reply Quote 0
            • 1 / 1
            1 / 1
            • First post
              3/5
              Last post
            Buy SketchPlus
            Buy SUbD
            Buy WrapR
            Buy eBook
            Buy Modelur
            Buy Vertex Tools
            Buy SketchCuisine
            Buy FormFonts

            Advertisement