Hi all,
I'm trying to extract the plate thickness of given plates through Excel VBA.
I'm using STAAD connect update 3. Following is my macro, kindly let me know if any change in syntax has to be done. Thanks.
Sub GetPlateThick() Dim staad As Object Dim plateNo As Long Dim plateThkArray(0 To 3) As Variant Set staad = GetObject(, "staadpro.openstaad") plateNo = 27813 staad.Property.GetPlateThickness plateNo, plateThkArray Set staad = NothingEnd Sub
The problem is with the following variable type declaration –
Dim plateThkArray(0 To 3) As Variant
You need to define the variable type for this array as “double”, not variant. In OpenSTAAD, normally we don’t specify any variable type as variant as we have noticed few problems with this variable type. There are several OpenSTAAD functions which does not work properly if you specify the variable type incorrectly. So to extract the correct plate thickness value, modify the above mentioned line as –
Dim plateThkArray(0 To 3) As Double
This will solve the problem.
Answer Verified By: Cibin Antony