get_object_id_list#

dlubal.api.rfem.Application.get_object_id_list(self, *, object_type=None, parent_no=None, model_id=None)#

Retrieves object ids filtered by a specific type. If you want to retrieve all object ids, do not specify the object_type.

Parameters:
  • object_type (ObjectType | None) – The type of objects to retrieve. To get all object ids, omit it.

  • parent_no (int | None) – Unique identifier of the parent object. Omit this parameter if the object type does not have a parent or you want to get result for all parent objects.

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

Returns:

ObjectIdList

Method Type: Core


Usage

# Retrieve the list of all object IDs in the model
all_objects_ids  = rfem_app.get_object_id_list()

# Iterate through each object ID and print its type and number
for obj in all_objects_ids .object_id:

   object_no = obj.no
   object_type = obj.object_type

   print(f"{rfem.ObjectType.Name(object_type)}: {object_no}")

# Retrieve the list of object IDs for specific object type (=Node)
node_ids  = rfem_app.get_object_id_list(
   object_type=rfem.OBJECT_TYPE_NODE
)

# Get and print the last used  node number in the model
last_node_no = node_ids.object_id[-1].no
print(f"\nNode number (last used): {last_node_no}")

Output

OBJECT_TYPE_MATERIAL: 1
OBJECT_TYPE_MATERIAL: 2
OBJECT_TYPE_MATERIAL: 3
OBJECT_TYPE_SECTION: 1
OBJECT_TYPE_SECTION: 2
OBJECT_TYPE_SECTION: 3
OBJECT_TYPE_SECTION: 4
OBJECT_TYPE_THICKNESS: 1
OBJECT_TYPE_NODE: 1
OBJECT_TYPE_NODE: 2
OBJECT_TYPE_NODE: 3
OBJECT_TYPE_NODE: 4
OBJECT_TYPE_NODE: 5

Node number (last used): 5