get_object_id_list#
- dlubal.api.rsection.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 = rsection_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"{rsection.ObjectType.Name(object_type)}: {object_no}")
# Retrieve the list of object IDs just for specific object type (=Point)
point_ids = rsection_app.get_object_id_list(
object_type=rsection.OBJECT_TYPE_POINT
)
# Get and print the last used point number in the model
last_point_no = point_ids.object_id[-1].no
print(f"\Point number (last used): {last_point_no}")
// Retrieve the list of all object IDs in the model
var allObjectIds = await rsectionApp.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 just for specific object type (=Point)
var pointIds = await rsectionApp.get_object_id_list(
objectType: Rsection.ObjectType.Point
);
var lastPointNo = pointIds.ObjectId.Last().No;
Console.WriteLine($"\Point number (last used): {lastPointNo}");
Output
OBJECT_TYPE_MATERIAL: 1
OBJECT_TYPE_SECTION: 1000000
OBJECT_TYPE_OBJECT_SNAP: 1
OBJECT_TYPE_MEMBER_CONFIGURATION: 1
OBJECT_TYPE_MEMBER_CONFIGURATION: 2
OBJECT_TYPE_POINT: 1
OBJECT_TYPE_POINT: 2
OBJECT_TYPE_POINT: 3
OBJECT_TYPE_POINT: 4
OBJECT_TYPE_POINT: 5
Point number (last used): 5