How to move a group
-
hi guyes
I create a group and add to group facegroup1 = 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? -
@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'sentities
, then this is the global origin. If it is some other component's or group'sentities
, 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.
Advertisement