get_object_list#

dlubal.api.rstab.Application.get_object_list(self, objs, only_selected=False, model_id=None)#

Retrieves a list of objects from the model.

Parameters:
  • objs (list[obj]) – A list of model objects to retrieve. See Model.

  • only_selected (bool, optional) – If True, only returns objects from the list that are currently selected in the model.

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

Returns:

A list of the retrieved objects.

Return type:

list[obj]


Usage

# Fetch the list of specific object type = Member
member_list = rstab_app.get_object_list(
    objs=[rstab.structure_core.Member()]
)

# Iterate over each item in the list
for member in member_list:
    print(f"{member.DESCRIPTOR.name} No: {member.no}")

# Fetch the list of specific object type = MemberLoad
# with defined parent object = LoadCase No. 1
member_load_list = rstab_app.get_object_list(
    objs=[rstab.loads.MemberLoad(load_case=1)]
)

# Iterate over each item in the list
for member_load in member_load_list:
    print(f"{member_load.DESCRIPTOR.name} No: {member_load.no}")

# Fetch the list of all objects
all_object_list = rstab_app.get_object_list(
    objs=[rstab.All()]
)