get_object#
- dlubal.api.rfem.Application.get_object(self, obj, model_id=None)#
Retrieves a single object from the model using its number.
Usage
# Get Node number 1 from the active model and print its coordinates
node: rfem.structure_core.Node = rfem_app.get_object(
rfem.structure_core.Node(no=1)
)
print(f"Coordinates:\n{node.coordinates}")
Tip
While casting is not required in Python, explicitly specifying the object’s type (e.g., node: rfem.structure_core.Node
) can enhance IntelliSense and code completion.
// Get Node number 1 from the active model and print its coordinates
Rfem.StructureCore.Node node_1 = await RfemApp.get_object<Rfem.StructureCore.Node>(
new Rfem.StructureCore.Node{ No = 1 }
);
Console.WriteLine($"Coordinates:\n{node_1.Coordinates}");
Output
Coordinates:
y: 1
z: -3