Query

Accessed via app.query. All classes are read-only — they do not modify the model.

QueryFacade

class pyrobotstructural.query.facade.QueryFacade(raw_app)[source]

Bases: object

Read-only facade for querying the model and analysis results.

Accessed via app.query. Aggregates query classes for nodes, bars, load cases, combinations, model metadata, bar results, and shell results.

Parameters:

raw_app (Any)

NodesQuery

class pyrobotstructural.query.nodes.NodesQuery(raw_app)[source]

Bases: _BaseEditor

Parameters:

raw_app (Any)

get_all(exclude_calc_nodes=False)[source]

Gets all nodes in the Roboit Model

Parameters:

exclude_calc_nodes (bool) – Trigger to include or include calculation nodes

Return type:

Any

Returns:

IRobotCollection of nodes (exclude_calc_nodes=False), or list[IRobotNode] (exclude_calc_nodes=True)

get_all_in_list(exclude_calc_nodes=False)[source]

“Gets all nodes coordinates from Robot.

Parameters:

exclude_calc_nodes (bool) – Trigger to include or include calculation nodes

Return type:

list

Returns:

list[node_number, X, Y, Z]

get_node(index, by_number=False)[source]

Returns the node of given index.

Parameters:
  • index (int) – Index of a node

  • by_number (bool) – If node number instead of node index is to be used

Return type:

Any

Returns:

IRobotNode: object

get_compatible_nodes()[source]

Gets all nodes in the Robot Model.

Return type:

Any

Returns:

IRobotCollection: collection of nodes

get_node_coords(node)[source]

Returns coordinates of a node.

Parameters:

node (Any)

Return type:

list

Returns:

IRobotCollection: collection of nodes

BarsQuery

class pyrobotstructural.query.bars.BarsQuery(raw_app)[source]

Bases: _BaseEditor

Parameters:

raw_app (Any)

get_all()[source]

Gets all nodes in the Roboit Model.

Return type:

Any

Returns:

IRobotBarsServer: Server that manages bars defined in stucture

get_bar(bar_number, include_superbars=False)[source]

Returns the bar of given number.

Parameters:

bar_number (int) – index of a bar

Return type:

Any

Returns:

IRobotDataObject: bar object IRobotBar

get_bar_section_data(bar)[source]

Returns the bar section data.

Parameters:

bar (Any)

Return type:

Any

Returns:

section label data (IRobotBarSectionData))

get_all_bars_node_numbers()[source]
Return type:

list

Returns:

All bar data in a list [bar_number, start_node_nr, end_node_nr].

CasesQuery

class pyrobotstructural.query.loadcases.CasesQuery(raw_app)[source]

Bases: _BaseEditor

Parameters:

raw_app (Any)

get_all_load_cases()[source]
Return type:

Any

get_simple_loadcase(case_index=None, number=None)[source]
Parameters:
  • case_index (int) – Index for the loadcase.

  • number (int) – Number of the loadcase, overwrites index.

Returns:

You can provide either index or number of the combination.

Return type:

Any

to_latex(path, caption='Load Cases', label='tab:loadcases')[source]

Export simple load cases to a LaTeX table file.

Parameters:
  • path (str) – File path for the output .tex file.

  • caption (str) – Table caption. Defaults to “Load Cases”.

  • label (str) – LaTeX label for cross-referencing. Defaults to “tab:loadcases”.

Return type:

None

CombinationsQuery

class pyrobotstructural.query.combinations.CombinationsQuery(raw_app)[source]

Bases: _BaseEditor

Parameters:

raw_app (Any)

get_all(return_objects=True)[source]

Gets a list of objects or values depending on the input.

Parameters:

return_objects (bool) – Trigger to return IRobotCaseCombination or list with values

Returns:

IRobotCaseSever or list[name

Return type:

list | Any

get_combination_factors(lcomb)[source]

Returns list of (case_number, factor) pairs for a combination.

Parameters:

lcomb (Any) – Combination object returned by get_all or get_single.

Return type:

list[tuple[int, float]]

get_single(case_index, number=None)[source]

Gets combination of given number

Parameters:
  • case_index (int) – Index for the combination.

  • number (int) – Number of the combination, overwrites index.

Return type:

Any

to_latex(path, caption='Load Combinations', label='tab:combinations')[source]

Export load combinations to a LaTeX table file.

Parameters:
  • path (str) – File path for the output .tex file.

  • caption (str) – Table caption. Defaults to “Load Combinations”.

  • label (str) – LaTeX label for cross-referencing. Defaults to “tab:combinations”.

Return type:

None

ModelQuery

class pyrobotstructural.query.model.ModelQuery(raw_app)[source]

Bases: _BaseEditor

Parameters:

raw_app (Any)

get_model_path()[source]

Get Autodesk Robot model path.

Returns:

path – Path of current (active) model.

Return type:

str | Any

BarResultsQuery

class pyrobotstructural.query.results.BarResultsQuery(raw_app)[source]

Bases: _BaseEditor

Read-only access to bar member analysis results.

Wraps IRobotBarResultServer (Project.Structure.Results.Bars) and exposes internal forces, displacements, and stresses for individual bars and load cases.

Access path: app.query.results

Parameters:

raw_app (Any) – The raw RobotApplication COM object passed down from RobotApp.

get_forces(bar_number, case_number, position=0.5)[source]

Return internal forces at a single position along the bar.

Parameters:
  • bar_number (int) – Robot bar number.

  • case_number (int) – Load case or combination number.

  • position (float) – Relative position along the bar, 0.0 (start) to 1.0 (end). Defaults to 0.5 (midspan).

Returns:

Internal forces at the requested position.

Return type:

MemberForces

get_forces_at_points(bar_number, case_number, n_points=5)[source]

Return internal forces at evenly-spaced points along the bar.

Points are numbered 1 to n_points by Robot’s ValueByNPoints method, which spaces them uniformly from the start node to the end node.

Parameters:
  • bar_number (int) – Robot bar number.

  • case_number (int) – Load case or combination number.

  • n_points (int) – Number of evenly-spaced evaluation points. Defaults to 5.

Returns:

Forces at each point, ordered from start to end of the bar.

Return type:

list[MemberForces]

get_deflections(bar_number, case_number, position=0.5)[source]

Return deflection at a single position along the bar.

Parameters:
  • bar_number (int) – Robot bar number.

  • case_number (int) – Load case or combination number.

  • position (float) – Relative position along the bar, 0.0 (start) to 1.0 (end). Defaults to 0.5 (midspan).

Returns:

Deflection at the requested position. Rotation fields are set to 0 as RobotBarDeflectionData does not expose them.

Return type:

MemberDeflection

get_max_deflection(bar_number, case_number)[source]

Return max deflection in the bar.

Parameters:
  • bar_number (int) – Robot bar number.

  • case_number (int) – Load case or combination number.

Returns:

Maximum displacements (UX, UY, UZ). Rotation fields are set to 0 as RobotBarDeflectionData does not expose them.

Return type:

MemberDeflection

get_stresses(bar_number, case_number, pos=0.5)[source]

Return cross-section stresses at a single position along the bar.

Parameters:
  • bar_number (int) – Robot bar number.

  • case_number (int) – Load case or combination number.

  • pos (float) – Relative position along the bar, 0.0 (start) to 1.0 (end). Defaults to 0.5 (midspan).

Returns:

Cross-section stresses at the requested position.

Return type:

MemberStress

get_stresses_at_points(bar_number, case_number, n_points=5)[source]

Return cross-section stresses at evenly-spaced points along the bar.

Parameters:
  • bar_number (int) – Robot bar number.

  • case_number (int) – Load case or combination number.

  • n_points (int) – Number of evenly-spaced evaluation points. Defaults to 5.

Returns:

Stresses at each point, ordered from start to end of the bar.

Return type:

list[MemberStress]

ShellResultsQuery

class pyrobotstructural.query.results.ShellResultsQuery(raw_app)[source]

Bases: _BaseEditor

Read-only access to planar shell finite element analysis results.

Wraps IRobotFeResultServer (Project.Structure.Results.FiniteElems) and exposes in-plane forces and stresses for individual FE elements, load cases, and through-thickness layers.

Access path: app.query.shell_results

Parameters:

raw_app (Any) – The raw RobotApplication COM object passed down from RobotApp.

Notes

Results are retrieved via IRobotFeResultDetailed, which requires an IRobotFeResultParams object specifying the element number, load case, and through-thickness layer. Use ShellLayer constants to select the layer:

  • ShellLayer.TOP — upper (top) surface

  • ShellLayer.MID — mid-plane (default)

  • ShellLayer.BOTTOM — lower (bottom) surface

get_forces(element_number, case_number, layer=None)[source]

Return in-plane forces and moments for a single FE element.

Parameters:
  • element_number (int) – Finite element number in Robot.

  • case_number (int) – Load case or combination number.

  • layer (Any) – Through-thickness layer at which results are evaluated. Accepts ShellLayer.TOP, ShellLayer.MID, or ShellLayer.BOTTOM. Defaults to ShellLayer.MID.

Returns:

In-plane forces and moments per unit width at the requested layer.

Return type:

ShellForces

get_stresses(element_number, case_number, layer=None)[source]

Return in-plane stresses (including von Mises) for a single FE element.

Parameters:
  • element_number (int) – Finite element number in Robot.

  • case_number (int) – Load case or combination number.

  • layer (Any) – Through-thickness layer at which results are evaluated. Accepts ShellLayer.TOP, ShellLayer.MID, or ShellLayer.BOTTOM. Defaults to ShellLayer.MID.

Returns:

In-plane and transverse stresses at the requested layer, including the computed von Mises stress.

Return type:

ShellStresses

Notes

Von Mises stress is derived from the Cauchy in-plane stress components using the plane-stress formula:

\[\sigma_{vm} = \sqrt{\sigma_{xx}^2 + \sigma_{yy}^2 - \sigma_{xx}\,\sigma_{yy} + 3\,\tau_{xy}^2}\]

Result dataclasses

class pyrobotstructural.query.results.MemberForces(fx, fy, fz, mx, my, mz)[source]

Bases: object

Internal forces at a single point on a bar member.

All values are returned in Robot’s internal SI units.

Parameters:
  • fx (float)

  • fy (float)

  • fz (float)

  • mx (float)

  • my (float)

  • mz (float)

fx

Axial force [N].

Type:

float

fy

Shear force in the local Y direction [N].

Type:

float

fz

Shear force in the local Z direction [N].

Type:

float

mx

Torsional moment about the local X axis [Nm].

Type:

float

my

Bending moment about the local Y axis [Nm].

Type:

float

mz

Bending moment about the local Z axis [Nm].

Type:

float

fx: float
fy: float
fz: float
mx: float
my: float
mz: float
class pyrobotstructural.query.results.MemberDeflection(ux, uy, uz, rx, ry, rz)[source]

Bases: object

Displacements and rotations at a single point on a bar member.

All values are returned in Robot’s internal SI units.

Parameters:
  • ux (float)

  • uy (float)

  • uz (float)

  • rx (float)

  • ry (float)

  • rz (float)

ux

Displacement in the global X direction [m].

Type:

float

uy

Displacement in the global Y direction [m].

Type:

float

uz

Displacement in the global Z direction [m].

Type:

float

rx

Rotation about the global X axis [rad].

Type:

float

ry

Rotation about the global Y axis [rad].

Type:

float

rz

Rotation about the global Z axis [rad].

Type:

float

ux: float
uy: float
uz: float
rx: float
ry: float
rz: float
class pyrobotstructural.query.results.MemberStress(smax, smin, shear_y, shear_z, torsion)[source]

Bases: object

Cross-section stresses at a single point on a bar member.

All values are returned in Robot’s internal SI units.

Parameters:
  • smax (float)

  • smin (float)

  • shear_y (float)

  • shear_z (float)

  • torsion (float)

smax

Maximum normal stress (tension positive) [Pa].

Type:

float

smin

Minimum normal stress (compression negative) [Pa].

Type:

float

shear_y

Shear stress in the local Y direction [Pa].

Type:

float

shear_z

Shear stress in the local Z direction [Pa].

Type:

float

torsion

Torsional shear stress [Pa].

Type:

float

smax: float
smin: float
shear_y: float
shear_z: float
torsion: float
class pyrobotstructural.query.results.ShellForces(nxx, nyy, nxy, mxx, myy, mxy, qxx, qyy)[source]

Bases: object

In-plane forces and moments per unit width for a shell finite element.

Values correspond to the fields of IRobotFeResultDetailed and are expressed per unit width of the shell mid-plane.

Parameters:
  • nxx (float)

  • nyy (float)

  • nxy (float)

  • mxx (float)

  • myy (float)

  • mxy (float)

  • qxx (float)

  • qyy (float)

nxx

Membrane (normal) force in the local X direction [N/m].

Type:

float

nyy

Membrane (normal) force in the local Y direction [N/m].

Type:

float

nxy

Membrane shear force [N/m].

Type:

float

mxx

Bending moment about the local Y axis per unit width [Nm/m].

Type:

float

myy

Bending moment about the local X axis per unit width [Nm/m].

Type:

float

mxy

Torsional (twisting) moment per unit width [Nm/m].

Type:

float

qxx

Transverse shear force in the local X direction [N/m].

Type:

float

qyy

Transverse shear force in the local Y direction [N/m].

Type:

float

nxx: float
nyy: float
nxy: float
mxx: float
myy: float
mxy: float
qxx: float
qyy: float
class pyrobotstructural.query.results.ShellStresses(sxx, syy, sxy, txx, tyy, mises)[source]

Bases: object

In-plane and transverse stresses for a shell finite element.

Values correspond to the fields of IRobotFeResultDetailed. Von Mises stress is computed from the Cauchy in-plane components.

Parameters:
  • sxx (float)

  • syy (float)

  • sxy (float)

  • txx (float)

  • tyy (float)

  • mises (float)

sxx

Normal stress in the local X direction, σxx [Pa].

Type:

float

syy

Normal stress in the local Y direction, σyy [Pa].

Type:

float

sxy

In-plane shear stress, τxy [Pa].

Type:

float

txx

Transverse shear stress in the local X direction [Pa].

Type:

float

tyy

Transverse shear stress in the local Y direction [Pa].

Type:

float

mises

Von Mises equivalent stress [Pa], computed as sqrt(σxx² + σyy² σxx·σyy + 3·τxy²).

Type:

float

sxx: float
syy: float
sxy: float
txx: float
tyy: float
mises: float