Applies To | |||
Product(s): | STAAD.Pro | ||
Version(s): | All | ||
Environment: | N/A | ||
Area: | OpenSTAAD | ||
Subarea: | Load | ||
Original Author: | Bentley Technical Support Group, Shreyanka Bhattacharjee | ||
Problem Description:
How to create wind definition and add height vs intensity data using OpenSTAAD function (VBA and python)
Solution:
You need use these two functions
Parameter of function AddWindDefinition:
[input] TypeNo: Wind Definition Type number ID
[input] TypeName: Wind Definition name
Parameter of function AddWindIntensity:
[Input] TypeNo: Wind Definition Type number ID
[Input] Intensity: Intensity value (Unit: Force/Length^2)
[Input] Height: Height value (Unit: Length)
Sample VBA Syntax:
Set objOpenStaad = GetObject(, "StaadPro.OpenSTAAD")
Dim TypeNo As Long
Dim TypeName As String
Dim intensity(1) As Double
Dim height(1) As Double
TypeNo = 1
TypeName = "WIND 1"
objOpenStaad.Load.AddWindDefinition TypeNo, TypeName
intensity(0) = 1.24
intensity(1) = 1.41
height(0) = 10
height(1) = 15
objOpenStaad.Load.AddWindIntensity TypeNo, intensity, height
Output:
python script:
from comtypes import automation
from comtypes import client
import ctypes
from comtypes import npsupport
import numpy as np
npsupport.enable()
os = client.GetActiveObject("StaadPro.OpenSTAAD")
os = client.GetActiveObject("StaadPro.OpenSTAAD")
load = os.Load
TypeNo=1
TypeName="WIND 1"
load._FlagAsMethod("AddWindDefinition")
load.AddWindDefinition (TypeNo, TypeName)
intensity=np.array([1.0,2.0])
height=np.array([10.0,15.0])
load._FlagAsMethod("AddWindIntensity")
load.AddWindIntensity (TypeNo, intensity, height)
varNodeNoArray=np.array([6,7,8,9])
ExposureFactor=1
load._FlagAsMethod("AddWindExposure")
load.AddWindExposure (TypeNo, ExposureFactor, varNodeNoArray)