mirror_objects#

dlubal.api.rsection.Application.mirror_objects(self, objs, mirroring_type=None, point_1=None, point_2=None, axis=None, create_copy=False, model_id=None, skip_invalid_attributes=None, numbering_increments=None)#

Mirrors or copies the specified objects.

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

  • mirroring_type (MirroringAxisSpecificationType) – Specifies the type of mirroring axis.

  • point_1 (Vector2d | None) – Specifies point 1 for mirror axis definition.

  • point_2 (Vector2d | None) – Specifies point 2 for mirror axis definition.

  • axis (CoordinateAxis | None) – Specifies the axis for mirror axis definition.

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

  • 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.mirror_objects(
    objs=[
        rsection.structure_core.Point(no=1),
        rsection.structure_core.Line(no=1),
    ],
    mirroring_type=rsection.manipulation.MIRRORING_PLANE_SPECIFICATION_TYPE_POINT_AND_PARALLEL_AXIS,
    point_1=common.Vector2d(y=0.0, z=0.0),
    axis=rsection.manipulation.COORDINATE_AXIS_Z,
    create_copy=True,
    # Optional: the k-th copy is numbered '<original number> + k * 100'
    numbering_increments={rsection.OBJECT_TYPE_POINT: 100}
)