move_objects#
- dlubal.api.rfem.Application.move_objects(self, objs, direction_through, coordinate_system=1, displacement_vector=None, axis=None, create_copy=False, number_of_steps=None, spacing=None, copy_including_loading=False, copy_including_imperfections=False, connect_lines_members_surfaces=False, 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.
direction_through (DirectionThrough) – Specifies the type of direction through which the objects will be moved.
coordinate_system (int | 1) – Specifies the coordination system to use.
displacement_vector (Vector3d | None) – Specifies the displacement vector for vector-based movement.
axis (CoordinateAxis | None) – Specifies the axis for parallel movement.
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.
spacing (double | None) – Specifies the spacing between copies for parallel movement.
copy_including_loading (bool | False) – Specifies whether to include the loading when copying the objects.
copy_including_imperfections (bool | False) – Specifies whether to include imperfections when copying the objects.
connect_lines_members_surfaces (bool | False) – Specifies whether to connect lines, members, or surfaces when they overlap in the copy.
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_copyis 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 existsand 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
rfem_app.move_objects(
objs=rfem_app.get_object_list(
objs=[rfem.structure_core.Node()]
),
direction_through=rfem.manipulation.DIRECTION_THROUGH_DISPLACEMENT_VECTOR,
displacement_vector=common.Vector3d(x=0.0, y=5.0, z=0.0),
create_copy=True,
number_of_steps=2,
# Optional: the k-th copy is numbered '<original number> + k * 100'
numbering_increments={rfem.OBJECT_TYPE_NODE: 100}
)
rfemApp.move_objects(
objs: rfemApp.get_object_list(
objs: new List<IMessage> {
new Rfem.StructureCore.Node {},
}
),
directionThrough: Rfem.Manipulation.DirectionThrough.DisplacementVector,
displacementVector: new Common.Vector3d{X=0.0, Y=5.0, Z=0.0},
createCopy: true,
numberOfSteps: 2,
// Optional: the k-th copy is numbered '<original number> + k * 100'
numberingIncrements: new Dictionary<Rfem.ObjectType, int>
{
{ Rfem.ObjectType.Node, 100 },
}
);
Examples