| Applies To | |||
| Product(s): | STAAD.Pro | ||
| Version(s): | All | ||
| Environment: | N/A | ||
| Area: | OpenSTAAD | ||
| Subarea: | General | ||
| Original Author: | Bentley Technical Support Group | ||
Problem Description:
How to open/create a STAAD file using OpenSTAAD function
Solution:
Parameter (For function OpenSTAADFile):
[Input] bstrFileName = A string variable that will hold the name of the .STD file along with the path
Sample VBA Syntax (For function OpenSTAADFile):
Dim bstrFileName As String
Set objOpenSTAAD = GetObject(, "StaadPro.OpenSTAAD")
bstrFileName = "D:\test\Structure1.STD"
objOpenSTAAD.OpenSTAADFile bstrFileName
Parameter (For function NewSTAADFile):
[Input] bstrFileName = A string variable that will hold the name of the .STD file along with the path
[Input] nLenUnitInput = 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)
[Input] nForceUnitInput = 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)
Sample VBA Syntax (For function NewSTAADFile):
Dim bstrFileName As String
Dim nLenUnitInput As Long
Dim nForceUnitInput As Long
Set objOpenSTAAD = GetObject(, "StaadPro.OpenSTAAD")
bstrFileName = "D:\test\Structure8.STD"
nLenUnitInput = 4 ‘Meter
nForceUnitInput = 5 ‘ Kilo Newton
objOpenSTAAD.NewSTAADFile bstrFileName, nLenUnitInput, nForceUnitInput