Open STAAD Training

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 27

OpenSTAAD and VBA

Running STAAD Commands from Excel

Vishal Kumar 22nd May 2018


Contents

 What is OpenSTAAD
 OpenSTAAD Features
 Connecting STAAD with Excel
 OpenSTAAD Reference Manual
 OpenSTAAD Functions
 Opening/Creating a new STAAD File
 Workshop

2
What is Open STAAD
 OpenSTAAD is a library of exposed functions allowing engineers access to
STAAD.Pro’s internal functions and routines as well as its graphical
commands.

 With OpenSTAAD, you can use Visual Basic for Applications (VBA) macros to
perform such tasks as automating repetitive modeling or post-processing
tasks or embedding customized design routines.

 OpenSTAAD allows engineers and other users to link in-house or third-party


applications with STAAD.Pro. For example, a user might create a
spreadsheet in Excel to analyze and design a circular base plate using
support reactions from STAAD.

3
OpenSTAAD – More Features
 With OpenSTAAD, a simple macro can be written in Excel or within the
STAAD environment to retrieve the appropriate STAAD data and
automatically link the results.

 With a built-in VBA editor, macros can be written inside STAAD using VBA to
create new dialog boxes or menu items which run design codes or specific
structural components (like certain connections) that automatically link to
STAAD’s familiar reporting tables.

4
WHAT ALL CAN THIS OPENSTAAD API DO ?

 STAAD File Input and Output (I/O)


 Structure Geometry
 Member Specifications
 Properties
 Loads
 Output Results
 Nodes
 Beams
 Plates
 Solids
 STAAD Pre-Processor
 STAAD Post-Processor
 Creating Dialog Boxes and Menu Items

5
Connecting STAAD with Excel

 In Visual Basic for Applications (VBA), this may be done by creating an object
variable and then assigning to it the OpenSTAAD object. The VBA GetObject
function may be used for this.

 Where:
 MyObject: the Object name declared in a previous Dim statement.
 Filepath: the optional string providing the full file path and name of the file
containing objects to retrieve. In the case of OpenSTAAD, this can be omitted,
along with the trailing comma.
 Objectclass: the string representing the class of the object. In the case of
OpenSTAAD, this is always Staadpro.OpenSTAAD.
 Thus :

6
Connecting STAAD with Excel

 Example:

7
STAAD Object declarations

 Work on the former, if you want to work on the model and the latter if you just
want to work on the results.

8
Adding OpenSTAAD to References

 Go to References  Select OpenSTAAD UI

 Now, when the Browse Object tool is selected, you will see OpenSTAAD
functions included in the Library list.

9
OpenStaad Functions

 Refer OpenSTAAD Manual

10
Opening a Staad File

 Example

 File name should be full address of the file.

11
New Staad File

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

 Where:
 FileName : A string variable that will hold the name of the .STD file, which needs
to be created.
 InputUnitForLength : An integer variable that will hold the input unit to be assigned
for length of the new .STD file. Value may vary from 0 to 7 (0- Inch, 1- Feet, 2-
Feet, 3- CentiMeter, 4-Meter, 5- MilliMeter, 6 - DeciMeter, 7 – KiloMeter).
 InputUnitForForce : An integer variable that will hold the input unit to be assigned
for force of the new .STD file. Value may vary from 0 to 7 (0- Kilopound, 1- Pound,
2- Kilogram, 3-Metric Ton, 4- Newton, 5-Kilo Newton, 6- Mega Newton, 7-
DecaNewton).

12
New Staad File

13
 The session now onwards will go on as a Workshop.

 Target is to create a simple beam design sheet which will use STAAD in
background for calculation.

 Most major OpenSTAAD commands will be used.

 Developer’s daily work will be simulated.

14
ROOT FUNCTIONS

 Analyze
 CloseSTAADFile
 GetBaseUnit
 GetInputUnitForForce
 ShowApplication
 UpdateStructure

15
GEOMETRY FUNCTIONS

 Geometry.AddBeam
 Geometry.AddMultipleBeams
 Geometry.AddMultipleNodes
 Geometry.AddMultiplePlates
 Geometry.DeleteBeam
 Geometry.DeletePlate

16
VIEW FUNCTIONS

 View.CreateNewViewForSelections
 View.HideAllMembers
 View.HideEntity
 View.HideMember
 View.HidePlate
 View.HideSolid

17
PROPERTIES FUNCTIONS

 Property.AssignBeamProperty
 Property.AssignBetaAngle
 Property.AssignPlateThickness
 Property.CreateBeamPropertyFromTable
 Property.CreateMemberCompressionSpec
 Property.CreateMemberPartialReleaseSpec

18
LOADS FUNCTIONS

 Load.AddElementPressure
 Load.AddLoadAndFactorToCombination
 Load.AddMemberConcForce
 Load.AddMemberUniformMoment
 Load.AddStrainLoad
 Load.GetActiveLoad

19
SUPPORTS FUNCTIONS

 Support.AssignSupportToNode
 Support.CreateSupportFixed
 Support.GetSupportCount
 Support.GetSupportNodes
 Support.GetSupportType

20
COMMAND FUNCTIONS

 Command.CreateSteelDesignCommand
 Command.PerformAnalysis
 Command.PerformPDeltaAnalysisConverge
 Command.PerformPDeltaAnalysisNoConverge

21
OUTPUT RESULTS FUNCTIONS

 Output.GetAllPlateCenterForces
 Output.GetAllPlateCenterMoments
 Output.GetAllPlateCenterStressesAndMoments
 Output.GetAllSolildNormalStresses
 Output.GetIntermediateMemberForcesAtDistance
 Output.GetMemberEndForces

22
RESULTS TABLE FUNCTIONS

 Table.AddTable
 Table.CreateReport
 Table.DeleteTable

23
ROOT FUNCTIONS

 Analyze
 CloseSTAADFile
 GetBaseUnit
 GetInputUnitForForce
 ShowApplication
 UpdateStructure

24
Function Return Value

 Useful while checking if the openstaad function is working fine or not.

 Most OpenSTAAD functions return a value to either:


 indicate the success or failure of the function (a Boolean result), or
 results value of the function (a numeric value result).

 If a function returns a Boolean result and that return value for an OpenSTAAD
function is equal to 0 (zero), it means that OpenSTAAD was unable to
execute the function.

 A return value of 1 (one) indicates that OpenSTAAD successfully executed


the function.

25
Questions…?
shi-fw.com

You might also like