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:
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}")
// Retrieve the list of all object IDs in the model
var allObjectIds = await rfemApp.get_object_id_list();
// Iterate through each object ID and print its type and number
foreach (var obj in allObjectIds.ObjectId)
{
var objectNo = obj.No;
var objectType = obj.ObjectType;
Console.WriteLine($"{objectType}: {objectNo}");
}
// Retrieve the list of object IDs for specific object type (=Node)
var nodeIds = await rfemApp.get_object_id_list(
objectType: Rfem.ObjectType.Node
);
// Get and print the last used node number in the model
var lastNodeNo = nodeIds.ObjectId.Last().No;
Console.WriteLine($"\nNode number (last used): {lastNodeNo}");
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