sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    How to move a group

    Scheduled Pinned Locked Moved Developers' Forum
    2 Posts 2 Posters 4 Views 2 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.
    • M Offline
      mr_Creator
      last edited by

      hi guyes
      I create a group and add to group face

      
      group1 = entities.add_group
      face = group1.definition.entities.add_face(f[0], f[1], f[2], f[3])
      
      

      Next I will rotate everything in this group

      
      [X_AXIS, Y_AXIS].each { |axis|
      	if not face.normal.samedirection?(Z_AXIS)
      	   if face.normal.perpendicular?(axis)
      		  angle = face.normal.angle_between(axis)
      		  angle = 180 - (angle * 180 / Math;;PI)
      		  rotation = Geom;;Transformation.rotation(group1.bounds.center, axis, angle.degrees)
      		  group1.entities.transform_entities(rotation, group1.entities.to_a)
      		end
      	end
      }
      
      

      Next I need to move everything to the origin of global coordinates. How to do it?
      group1.transformation.origin have zero coordinats, but group1 is not at zero.
      how to move a group or its contents to another location?

      1 Reply Last reply Reply Quote 0
      • Dan RathbunD Offline
        Dan Rathbun
        last edited by

        @mr_creator said:

        Next I need to move everything to the origin of global coordinates.

        
        group1 = entities.add_group
        
        

        This line of code will create a new group at the origin of entities. If this is the top level model's entities, then this is the global origin. If it is some other component's or group's entities, then it is their local origin.

        @mr_creator said:

        group1.transformation.origin have zero coordinates, but group1 is not at zero.

        This confirms then that group1's origin is at the origin of the active edit context's origin.

        I'm not here much anymore.

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

        Advertisement