Root Module

12 min read

Analyze #

This function analyzes the currently opened .STD file. This method is equivalent to running analysis from user interface.

VBA Syntax


AnalyzeEx #

This extended method analyzes the currently opened .STD file. This method is equivalent to running analysis from user interface. However, it has additional three arguments to specify whether to run the analysis in silent or hidden mode. The third parameter specifies whether the method should wait for the analysis to finish or return immediately. This method may be used in conjunction with SetSilentMode(), if one wants to suppress all dialog boxes displayed from the application during running of analysis.

Parameters

[in]varSilentInteger value to enable silent mode. [1 = Enable, 0 otherwise]. Enabling silent mode will suppress all dialog boxes in the engine which requires user input. The analysis dialog box however will be displayed and close automatically on completion.
[in]varHiddenInteger value to enable hidden mode. [1 = Enable, 0 = Disable]. Enabling hidden mode will suppress the display of analysis dialog. The analysis dialog box will not be displayed.
[in]varWaitInteger value to specify whether to wait for the analysis process to finish or return immediately. [1 to wait , 0 otherwise]

Return values

-1Analysis Terminated
0General Error
1Analysis is in progress
2Analysis completed without errors or warnings
3Analysis completed with warnings but without errors
4Analysis completed with errors
5Analysis has not been performed

VBA Syntax


AnalyzeModel #

Analyze the model currently opened in staad.pro.

Parameters

  • [in] varEngine: Put -1 for launching STAAD.Pro engine.

VBA Syntax

C# Syntax


CloseSTAADFile #

This function closes the currently open .STD file.

VBA Syntax


CreateNamedView #

This function creates a view with the specified name.

Parameters:

  • [in] strName: A string variable that will hold the name of the view to be created.
  • [in] nFlag: A long variable that holds the flag value based on which the view will be created.
  • [in] nError: A long variable that will hold the error number if the view cannot be created.

VBA Syntax:


GetAnalysisStatus #

This function gets the analysis status for any STD model.

Parameters:

  • [in] szModelNameWithPath: Name of the model for which analysis status is required.
  • [out] NoOfWarnings: Number of warnings produced by the STAAD engine while analyzing.
  • [out] NoOfErrors: Number of errors produced by the STAAD engine while analyzing.
  • [out] CPUTime: Time required by the STAAD engine to analyze the model in seconds.

Return Values:

  • -2: Invalid model path
  • -1: Analysis terminated
  • 0: General error
  • 1: Analysis is in progress
  • 2: Analysis completed without errors or warnings
  • 3: Analysis completed with warnings but without errors
  • 4: Analysis completed with errors
  • 5: Analysis has not been performed

VBA Syntax:


GetApplicationVersion #

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

Parameters:

  • [out] MajorA: An integer value representing the version number.
  • [out] MajorB: An integer value representing the update number.
  • [out] Minor: An integer value representing the revision number.
  • [out] Build: An integer value representing the build number.

Return Value:

  • The current application version as text.

VBA Syntax:


GetBaseUnit #

This function returns the base unit for the currently open .STD file.

Return Values:

  • 1: Value will return 1 for the English system of units (e.g., inches, kilopounds).
  • 2: Value will return 2 for the Metric system of units (e.g., meters, kilonewtons).

VBA Syntax:


GetCONNECTEDProjectInfo #

This function retrieves the CONNECTED Project ID and name.

Parameters:

  • [out] szProjID: ID of the CONNECTED Project.
  • [out] szName: Name of the CONNECTED Project.

Return Values:

  • 1: True
  • 0: False

VBA Syntax:


GetErrorMessage #

This function returns error messages thrown by OpenSTAAD (e.g., for license unavailability or required named view).

Return Value:

  • errmsg: Error message thrown by OpenSTAAD.

VBA Syntax:


GetFullJobInfo #

This function retrieves the full job information of the currently open .STD file.

Parameters:

  • [in] jobName: Job Name for the current .STD file.
  • [in] jobClient: Job Client for the current .STD file.
  • [in] enggName: Engineer’s Name for the current .STD file.
  • [in] eDate: Engineer Date for the current .STD file.
  • [in] jobNumber: Job Number for the current .STD file.
  • [in] revision: Job Revision for the current .STD file.
  • [in] part: Job Part Name for the current .STD file.
  • [in] reference: Job Reference for the current .STD file.
  • [in] checkerName: Checker Name for the current .STD file.
  • [in] cDate: Checker Date for the current .STD file.
  • [in] approverName: Approver Name for the current .STD file.
  • [in] aDate: Approved Date for the current .STD file.
  • [in] comments: Job Comments for the current .STD file.

VBA Syntax:


GetInputUnitForForce #

This function retrieves the input unit of force of the currently open .STD file.

Parameters:

  • [in] strUnit: A string variable that holds the input unit for force (internally converted to an integer from 0 to 7).

Unit Values:

  • 0: Kilopound
  • 1: Pound
  • 2: Kilogram
  • 3: Metric Ton
  • 4: Newton
  • 5: Kilonewton
  • 6: Meganewton
  • 7: Decanewton

VBA Syntax:


GetInputUnitForLength #

This function retrieves the input unit of length for the currently open .STD file.

Parameters:

  • [in] strUnit: A string variable that holds the input unit for length (internally converted to an integer from 0 to 7).

Unit Values:

  • 0: Inch
  • 1: Feet
  • 2: Feet
  • 3: Centimeter
  • 4: Meter
  • 5: Millimeter
  • 6: Decimeter
  • 7: Kilometer

VBA Syntax:


GetMainWindowHandle #

This function retrieves the main STAAD.Pro window handle.

VBA Syntax:


GetProcessHandle #

This function retrieves the current STAAD.Pro process handle.

VBA Syntax:


GetProcessId #

This function retrieves the current STAAD.Pro process ID.

VBA Syntax:


GetShortJobInfo #

This function retrieves the short job information of the currently open .STD file.

Parameters:

  • [in] jobName: A string variable that holds the Job Name for the current .STD file.
  • [in] jobClient: A string variable that holds the Job Client for the current .STD file.
  • [in] enggName: A string variable that holds the Engineer’s Name for the current .STD file.

VBA Syntax:


GetSTAADFile #

This function retrieves the name of the current .STD file.

Parameters:

  • [in] fileName: A string variable that will hold the name of the currently open .STD file (without the path name).
  • [in] bFullPath: A Boolean variable which, if true, writes the entire path name of the .STD file in the variable fileName.

VBA Syntax:


GetSTAADFileFolder #

This function retrieves only the path of the current .STD file, without the filename.

Parameters:

  • [in] fileFolder: A string variable that holds the path name of the folder where the currently open .STD file resides.

VBA Syntax:


IsAnalyzing #

This function returns a value to specify whether the analysis is running or not.

Return Values:

  • 1: If analysis is still running.
  • 0: If analysis is not running.

VBA Syntax:


IsPhysicalModel #

This function checks if the loaded model is a physical model.

Return Values:

  • 1: True (model is a physical model).
  • 0: False (model is not a physical model).

VBA Syntax:


ModifyNamedView #

This function saves the current view with the specified name.

Parameters:

  • [in] strName: A string variable that will hold the name of the view to be modified.
  • [in] nEntities: A long variable that holds the number of entities.
  • [in] EntityArray: A long variable that holds the entity number.
  • [in] nArrayQualifier: An integer variable that holds the entity qualifier value (0 – Node, 1 – Beam, 2 – Plate, 3 – Solid, 4 – Surface).
  • [in] nModifyFlag: A long variable that holds the flag value depending upon which the view will be modified.
  • [in] nError: A long variable that holds the error number if the view cannot be modified.

VBA Syntax:


NewSTAADFile #

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

Parameters:

  • [in] bstrFileName: A string variable that holds the name of the .STD file to be created.
  • [in] nLenUnitInput: An integer variable representing the input unit for length (0 to 7).
  • [in] nForceUnitInput: An integer variable representing the input unit for force (0 to 7).

Length Unit Values:

  • 0: Inch
  • 1: Feet
  • 2: Feet
  • 3: Centimeter
  • 4: Meter
  • 5: Millimeter
  • 6: Decimeter
  • 7: Kilometer

Force Unit Values:

  • 0: Kilopound
  • 1: Pound
  • 2: Kilogram
  • 3: Metric Ton
  • 4: Newton
  • 5: Kilonewton
  • 6: Meganewton
  • 7: Decanewton

VBA Syntax:


OpenSTAADFile #

This function opens the specified .STD file.

Parameters:

  • [in] bstrFileName: A string variable that holds the name of the .STD file to be opened.

VBA Syntax:


Quit #

This function closes the STAAD.Pro application environment.

VBA Syntax:


RemoveNamedView #

This function removes the current view with the specified name.

Parameters:

  • [in] strName: A string variable that holds the name of the view to be removed.
  • [in] nError: A long variable that holds the error number if the view cannot be removed.

VBA Syntax:


SaveModel #

This function saves the current structure with optional silent mode.

Parameters:

  • [in] varSilent: Integer value to enable silent mode (1 to enable, 0 to disable).

VBA Syntax:


SaveNamedView #

This function saves the current view with the specified name.

Parameters:

  • [in] strName: A string variable that holds the name of the view to be saved.
  • [in] nError: A long variable that holds the error number if the view cannot be saved.

VBA Syntax:


SetCONNECTEDProjectInfo #

This function sets the CONNECTED Project ID and name.

Parameters:

  • [in] szProjID: ID of the CONNECTED Project.
  • [in] szName: Name of the CONNECTED Project.

Return Values:

  • 1: True
  • 0: False

VBA Syntax:


SetFullJobInfo #

This function sets the full job information of the currently open .STD file.

Parameters:

  • [in] jobName: Job Name for the current .STD file.
  • [in] jobClient: Job Client for the current .STD file.
  • [in] enggName: Engineer’s Name for the current .STD file.
  • [in] eDate: Engineer Date for the current .STD file.
  • [in] jobNumber: Job Number for the current .STD file.
  • [in] revision: Job Revision for the current .STD file.
  • [in] part: Job Part Name for the current .STD file.
  • [in] reference: Job Reference for the current .STD file.
  • [in] checkerName: Checker Name for the current .STD file.
  • [in] cDate: Checker Date for the current .STD file.
  • [in] approverName: Approver Name for the current .STD file.
  • [in] aDate: Approved Date for the current .STD file.
  • [in] comments: Job Comments for the current .STD file.

VBA Syntax:


SetInputUnitForForce #

This function sets the input unit of force for the currently open .STD file.

Parameters:

  • [in] iUnit: An integer variable representing the input unit for force (0 to 7).

VBA Syntax:


SetInputUnitForLength #

This function sets the input unit of length for the currently open .STD file.

Parameters:

  • [in] iUnit: An integer variable representing the input unit for length (0 to 7).

VBA Syntax:


SetInputUnits #

This function sets the input units for both length and force of the currently open .STD file.

Parameters:

  • [in] lUnit: An integer variable for length unit (0 to 7).
  • [in] fUnit: An integer variable for force unit (0 to 7).

VBA Syntax:


SetShortJobInfo #

This function sets the short job information of the currently open .STD file.

Parameters:

  • [in] jobName: Job Name for the current .STD file.
  • [in] jobClient: Job Client for the current .STD file.
  • [in] enggName: Engineer’s Name for the current .STD file.

VBA Syntax:


SetSilentMode #

This function sets the silent mode of the application. Calling this method with 1 will suppress the display of warning message boxes during analysis and saving the file.

Parameters:

  • [in] varFlag: An integer value (1 to set silent mode on, 0 to set it off).

Return Values:

  • The existing value of the silent mode.

VBA Syntax:


UpdateStructure #

This function updates the current structure.

VBA Syntax: