convert_objects#

dlubal.api.rfem.Application.convert_objects(self, *, convert_into, objects, model_id=None)#

Converts specified objects into a different type.

Parameters:
  • convert_into (ConvertObjectInto) – Specifies the target conversion type.

  • objects (list) – Objects to be converted.

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

Returns:

None


Example

ifc_model_objects = rfem_app.get_object_list([rfem.ifc_objects.IfcModelObject()])

straight_members = list()

# Find IFC objects that will be converted to straight members
for ifc_object in ifc_model_objects:
    ifc_type = ifc_object.ifc_type
    if ifc_type in ["IfcColumn", "IfcBeam"]:
        straight_members.append(ifc_object)

# Make the conversion
rfem_app.convert_objects(
    convert_into=rfem.ConvertObjectInto.CONVERT_IFC_OBJECT_INTO_STRAIGHT_MEMBER,
    objects=straight_members,
)