get_object#

dlubal.api.rsection.Application.get_object(self, obj, model_id=None)#

Retrieves a single object from the model using only the no argument in the object arguments.

Parameters:
  • obj (obj) – An object to be retrieved defined by its number. Refer to the Model for available objects.

  • model_id (ModelId | None) – Unique identifier of the model.

Returns:

A retrieved object.

Return type:

Model


Usage

# Get Point number 1 from the active model and print its coordinates
point: rsection.structure_core.Point = rsection_app.get_object(
    rsection.structure_core.Point(no=1)
)
print(f"Coordinates:\n{point.coordinates}")

Tip

While casting is not required in Python, explicitly specifying the object’s type (e.g., point: rstab.structure_core.Point) can enhance IntelliSense and code completion.

Output

Coordinates:
y: 1
z: -3