Session/File (Root)

The STAAD.Pro session and file — open/close .STD files, set active units, read job info, and trigger analysis from the top-level object.

43 functions

Create

NewSTAADFile

Description

This function creates a .STD file with specified length and force units.

Function type

This function execute an action over the open staad file

Example

To use this function see the following example:

from openstaad import ops

# Connect to the running STAAD.Pro session
s = ops.connect()

# Execute de analize funcion from root module.
s.NewSTAADFile()

OpenSTAADFile

Description

Opens the STAAD file.

Parameters

  • file (str): file.

Returns

None: This function does not return a value.

Example

from openstaad import ops

s = ops.connect()
s.OpenSTAADFile("value")

Get

GetApplicationDesktopSize

Description

Returns the application desktop size.

Parameters

None.

Returns

tuple: A tuple of (int, int).

Example

from openstaad import ops

s = ops.connect()
result = s.GetApplicationDesktopSize()
print(result)

GetApplicationVersion

Retrieve the version of the application

This document explains how to retrieve the version of the application using OpenStaad python.

Description

Returns the application version number as text and in individual parts.

Function type

This function retrieves a value from the open staad file

Example

To use this function see the following example:

from openstaad import ops

# Connect to the running STAAD.Pro session
s = ops.connect()

# Execute de analize funcion from root module.
staad_version = s.GetApplicationVersion()

print(staad_version)

GetBaseUnit

Retrieve the base unit of your model

This document explains how to retrieve the base unit of your model using OpenStaad python.

Description

Returns the base unit for the currently open .STD file.

Function type

This function retrieves a value from the open staad file

Example

To use this function see the following example:

from openstaad import ops

# instantiate the root module
s = ops.connect()

# Execute the analyze function from root module.
units = s.GetBaseUnit()

print(units)

GetErrorMessage

Description

Returns the error message.

Parameters

None.

Returns

raw: The raw return value from the underlying OpenSTAAD COM call. Refer to the official Bentley OpenSTAAD API reference for this method's exact return semantics.

Example

from openstaad import ops

s = ops.connect()
result = s.GetErrorMessage()
print(result)

GetFullJobInfo

Description

Returns the full job info.

Parameters

None.

Returns

raw: The raw return value from the underlying OpenSTAAD COM call. Refer to the official Bentley OpenSTAAD API reference for this method's exact return semantics.

Example

from openstaad import ops

s = ops.connect()
result = s.GetFullJobInfo()
print(result)

GetInputUnitForForce

Description

Retrieves the input unit of force of the currently open .STD file.

Function type

This function retrive a value from the open staad file

Example

To use this function see the following example:

from openstaad import ops

# Connect to the running STAAD.Pro session
s = ops.connect()

# Execute de analize funcion from root module.
force_units = s.GetInputUnitForForce()

print(force_units)

GetInputUnitForLength

Description

Retrieves the input unit of length of the currently open .STD file.

Function type

This function retrive a value from the open staad file

Example

To use this function see the following example:

from openstaad import ops

# Connect to the running STAAD.Pro session
s = ops.connect()

# Execute de analize funcion from root module.
length_units = s.GetInputUnitForLength()

print(length_units)

GetMainWindowHandle

Description

Returns the main window handle.

Parameters

None.

Returns

raw: The raw return value from the underlying OpenSTAAD COM call. Refer to the official Bentley OpenSTAAD API reference for this method's exact return semantics.

Example

from openstaad import ops

s = ops.connect()
result = s.GetMainWindowHandle()
print(result)

GetOutputUnitForDensity

Description

Returns the output unit for density.

Parameters

None.

Returns

raw: The raw return value from the underlying OpenSTAAD COM call. Refer to the official Bentley OpenSTAAD API reference for this method's exact return semantics.

Example

from openstaad import ops

s = ops.connect()
result = s.GetOutputUnitForDensity()
print(result)

GetOutputUnitForDimension

Description

Returns the output unit for dimension.

Parameters

None.

Returns

raw: The raw return value from the underlying OpenSTAAD COM call. Refer to the official Bentley OpenSTAAD API reference for this method's exact return semantics.

Example

from openstaad import ops

s = ops.connect()
result = s.GetOutputUnitForDimension()
print(result)

GetOutputUnitForDisplacement

Description

Returns the output unit for displacement.

Parameters

None.

Returns

raw: The raw return value from the underlying OpenSTAAD COM call. Refer to the official Bentley OpenSTAAD API reference for this method's exact return semantics.

Example

from openstaad import ops

s = ops.connect()
result = s.GetOutputUnitForDisplacement()
print(result)

GetOutputUnitForDistForce

Description

Returns the output unit for dist force.

Parameters

None.

Returns

raw: The raw return value from the underlying OpenSTAAD COM call. Refer to the official Bentley OpenSTAAD API reference for this method's exact return semantics.

Example

from openstaad import ops

s = ops.connect()
result = s.GetOutputUnitForDistForce()
print(result)

GetOutputUnitForDistMoment

Description

Returns the output unit for dist moment.

Parameters

None.

Returns

raw: The raw return value from the underlying OpenSTAAD COM call. Refer to the official Bentley OpenSTAAD API reference for this method's exact return semantics.

Example

from openstaad import ops

s = ops.connect()
result = s.GetOutputUnitForDistMoment()
print(result)

GetOutputUnitForForce

Description

Returns the output unit for force.

Parameters

None.

Returns

raw: The raw return value from the underlying OpenSTAAD COM call. Refer to the official Bentley OpenSTAAD API reference for this method's exact return semantics.

Example

from openstaad import ops

s = ops.connect()
result = s.GetOutputUnitForForce()
print(result)

GetOutputUnitForMoment

Description

Returns the output unit for moment.

Parameters

None.

Returns

raw: The raw return value from the underlying OpenSTAAD COM call. Refer to the official Bentley OpenSTAAD API reference for this method's exact return semantics.

Example

from openstaad import ops

s = ops.connect()
result = s.GetOutputUnitForMoment()
print(result)

GetOutputUnitForRotation

Description

Returns the output unit for rotation.

Parameters

None.

Returns

raw: The raw return value from the underlying OpenSTAAD COM call. Refer to the official Bentley OpenSTAAD API reference for this method's exact return semantics.

Example

from openstaad import ops

s = ops.connect()
result = s.GetOutputUnitForRotation()
print(result)

GetOutputUnitForSectArea

Description

Returns the output unit for sect area.

Parameters

None.

Returns

raw: The raw return value from the underlying OpenSTAAD COM call. Refer to the official Bentley OpenSTAAD API reference for this method's exact return semantics.

Example

from openstaad import ops

s = ops.connect()
result = s.GetOutputUnitForSectArea()
print(result)

GetOutputUnitForSectDimension

Description

Returns the output unit for sect dimension.

Parameters

None.

Returns

raw: The raw return value from the underlying OpenSTAAD COM call. Refer to the official Bentley OpenSTAAD API reference for this method's exact return semantics.

Example

from openstaad import ops

s = ops.connect()
result = s.GetOutputUnitForSectDimension()
print(result)

GetOutputUnitForSectInertia

Description

Returns the output unit for sect inertia.

Parameters

None.

Returns

raw: The raw return value from the underlying OpenSTAAD COM call. Refer to the official Bentley OpenSTAAD API reference for this method's exact return semantics.

Example

from openstaad import ops

s = ops.connect()
result = s.GetOutputUnitForSectInertia()
print(result)

GetOutputUnitForSectModulus

Description

Returns the output unit for sect modulus.

Parameters

None.

Returns

raw: The raw return value from the underlying OpenSTAAD COM call. Refer to the official Bentley OpenSTAAD API reference for this method's exact return semantics.

Example

from openstaad import ops

s = ops.connect()
result = s.GetOutputUnitForSectModulus()
print(result)

GetOutputUnitForStress

Description

Returns the output unit for stress.

Parameters

None.

Returns

raw: The raw return value from the underlying OpenSTAAD COM call. Refer to the official Bentley OpenSTAAD API reference for this method's exact return semantics.

Example

from openstaad import ops

s = ops.connect()
result = s.GetOutputUnitForStress()
print(result)

GetProcessHandle

Description

Returns the process handle.

Parameters

None.

Returns

raw: The raw return value from the underlying OpenSTAAD COM call. Refer to the official Bentley OpenSTAAD API reference for this method's exact return semantics.

Example

from openstaad import ops

s = ops.connect()
result = s.GetProcessHandle()
print(result)

GetProcessId

Description

Returns the process Id.

Parameters

None.

Returns

raw: The raw return value from the underlying OpenSTAAD COM call. Refer to the official Bentley OpenSTAAD API reference for this method's exact return semantics.

Example

from openstaad import ops

s = ops.connect()
result = s.GetProcessId()
print(result)

GetShortJobInfo

Description

Returns the short job info.

Parameters

None.

Returns

tuple: A tuple of (str, str, str).

Example

from openstaad import ops

s = ops.connect()
result = s.GetShortJobInfo()
print(result)

GetSTAADFile

Description

Retrieves the name of the current .STD file..

Function type

This function retrive a value from the open staad file

Example

To use this function see the following example:

from openstaad import ops

# Connect to the running STAAD.Pro session
s = ops.connect()

# Execute de analize funcion from root module.
file_name = s.GetSTAADFile()

print(file_name)

GetSTAADFileFolder

Description

Retrieves only the path of the current .STD file.

Function type

This function retrive a value from the open staad file

Example

To use this function see the following example:

from openstaad import ops

# Connect to the running STAAD.Pro session
s = ops.connect()

# Execute de analize funcion from root module.
path = s.GetSTAADFileFolder()

print(path)

Set/Assign

SaveModel

Description

This function saves the current structure with optional silent mode.

Function type

This function retrive a value from the open staad file

Example

To use this function see the following example:

from openstaad import ops

# Connect to the running STAAD.Pro session
s = ops.connect()

# Execute de analize funcion from root module.
status = s.GetAnalysisStatus()

print(status)

SetCheckForIdenticalEntity

Description

Sets the check for identical entity.

Parameters

  • entityType (int): entity type.
  • checkFlag (bool): check flag.

Returns

value: See the official OpenSTAAD API reference for this method's exact return semantics.

Example

from openstaad import ops

s = ops.connect()
result = s.SetCheckForIdenticalEntity(1, True)
print(result)

SetFullJobInfo

Description

Sets the full job info.

Parameters

  • job_name (str): job name.
  • job_client (str, optional (default '')): job client.
  • eng_name (str, optional (default '')): eng name.
  • eng_date (str, optional (default '')): eng date.
  • job_number (str, optional (default '')): job number.
  • revision (str, optional (default '')): revision.
  • part_name (str, optional (default '')): part name.
  • reference (str, optional (default '')): reference.
  • checker_name (str, optional (default '')): checker name.
  • checker_date (str, optional (default '')): checker date.
  • approver_name (str, optional (default '')): approver name.
  • approval_date (str, optional (default '')): approval date.
  • comments (str, optional (default '')): comments.

Returns

None: This function does not return a value.

Example

from openstaad import ops

s = ops.connect()
s.SetFullJobInfo("value", "value", "value", "value", "value", "value", "value", "value", "value", "value", "value", "value", "value")

SetInputUnitForForce

Description

Sets the input unit for force.

Parameters

  • forceUnit (int): force unit.

Returns

value: See the official OpenSTAAD API reference for this method's exact return semantics.

Example

from openstaad import ops

s = ops.connect()
result = s.SetInputUnitForForce(1)
print(result)

SetInputUnitForLength

Description

Sets the input unit for length.

Parameters

  • lengthUnit (int): length unit.

Returns

value: See the official OpenSTAAD API reference for this method's exact return semantics.

Example

from openstaad import ops

s = ops.connect()
result = s.SetInputUnitForLength(1)
print(result)

SetInputUnits

Description

Sets the input units.

Parameters

  • lengthUnit (int): length unit.
  • forceUnit (int): force unit.

Returns

value: See the official OpenSTAAD API reference for this method's exact return semantics.

Example

from openstaad import ops

s = ops.connect()
result = s.SetInputUnits(1, 1)
print(result)

SetShortJobInfo

Description

Sets the short job info.

Parameters

  • job_name (str): job name.
  • job_id (str): job id.
  • job_status (str): job status.

Returns

None: This function does not return a value.

Example

from openstaad import ops

s = ops.connect()
s.SetShortJobInfo("value", "value", "value")

SetSilentMode

Description

Sets the silent mode.

Parameters

  • silent (bool): silent.

Returns

None: This function does not return a value.

Example

from openstaad import ops

s = ops.connect()
s.SetSilentMode(True)

SetUnits

Description

Sets the units.

Parameters

  • uType (int): u type.
  • strUnit (str): str unit.

Returns

None: This function does not return a value.

Example

from openstaad import ops

s = ops.connect()
s.SetUnits(1, "value")

UpdateStructure

Description

Updates the structure.

Parameters

None.

Returns

None: This function does not return a value.

Example

from openstaad import ops

s = ops.connect()
s.UpdateStructure()

Delete

CloseSTAADFile

Description

Closes the STAAD file.

Parameters

None.

Returns

None: This function does not return a value.

Example

from openstaad import ops

s = ops.connect()
s.CloseSTAADFile()

Quit

Description

Calls the Quit function on the OpenStaad ops session.

Parameters

None.

Returns

None: This function does not return a value.

Example

from openstaad import ops

s = ops.connect()
s.Quit()

View

ShowApplication

Description

Shows the application.

Parameters

None.

Returns

None: This function does not return a value.

Example

from openstaad import ops

s = ops.connect()
s.ShowApplication()

Is

IsPhysicalModel

Description

Checks whether physical model.

Parameters

None.

Returns

bool: True if the call succeeded, False otherwise.

Example

from openstaad import ops

s = ops.connect()
result = s.IsPhysicalModel()
print(result)

IsZUp

Description

Checks whether z up.

Parameters

None.

Returns

bool: True if the call succeeded, False otherwise.

Example

from openstaad import ops

s = ops.connect()
result = s.IsZUp()
print(result)