rotate_objects#

dlubal.api.rsection.Application.rotate_objects(self, objs, rotation_angle, point_1=None, create_copy=False, number_of_steps=None, model_id=None, skip_invalid_attributes=None, numbering_increments=None)#

Moves or copies the specified objects in a defined direction.

Parameters:
  • objs (list) – The list of specified model objects.

  • rotation_angle (float) – Specifies the angle for rotation.

  • point_1 (Vector2d | None) – Specifies the point 1 for vector-based rotation.

  • create_copy (bool | False) – Specifies whether copies of the specified objects should be created.

  • number_of_steps (int | None) – Specifies the number of copies to create.

  • model_id (ModelId | None) – The unique identifier of the model. If None, the active model is used.

  • skip_invalid_attributes (bool | None) – If True, invalid objects are skipped and returned as warnings.

  • numbering_increments (dict[ObjectType, int] | None) –

    Numbering increments for the created copies, keyed by object type. Applied only when create_copy is True.

    The k-th copy of an object is numbered <original number> + k * <increment>, counting the first copy as k = 1. Every copy therefore gets its own block of numbers, which lets objects modelled afterwards address a copy by arithmetic instead of by counting the objects of the original.

    An object type without an entry is numbered from the next free number, as it is without this argument.

    The increment is applied strictly, there is no fallback: if a number it would produce is already taken - by another object of the same type or by an earlier copy - the whole request is refused with Object '<type> No. <n>' already exists and nothing is created. Choose the increment so that the blocks it produces stay clear of the numbers already in use.

    An increment for an object type that is not among the copied objects is rejected.

Returns:

None

Method Type: Core


Usage

rsection_app.rotate_objects(
   objs=rsection_app.get_object_list(
         objs=[rsection.structure_core.Point()]
   ),
   rotation_angle=math.pi,
   point_1=common.Vector2d(y=0.0, z=0.0),
   create_copy=True,
   number_of_steps=1,
   # Optional: the k-th copy is numbered '<original number> + k * 100'
   numbering_increments={rsection.OBJECT_TYPE_POINT: 100}
)