Please somebody help me with this.
I' ve been trying to write a code to gather plates information I pick.
As you can see below my code, I can get the selected plates information such as plate number and thickness and node numbers.
There are two more things I really really really want to do.
First, I want to display this information on a Dialogue window.
Second, I want to select more plates and keep adding the information to the Dialogue window.
Please somebody be my hero,
'====================================
Sub Main()
Dim objOpenSTAAD As Object
Dim SelPlatesNo As Long, PlateNo As Long, SelPlates() As Long
Dim NodeA As Long, NodeB As Long, NodeC As Long, NodeD As Long
Dim CoordX As Double, CoordY As Double, CoordZ As Double
Set objOpenSTAAD = GetObject(, "StaadPro.OpenSTAAD")
SelPlatesNo = objOpenSTAAD.Geometry.GetNoOfSelectedPlates
If (SelPlatesNo > 0) Then
ReDim SelPlates(SelPlatesNo) As Long
End If
If (SelPlatesNo = 0) Then
MsgBox "Select Plate !!" , , " Warning "
Exit Sub
End If
objOpenSTAAD.Geometry.GetSelectedPlates SelPlates
Dim PlateData As String, PThickness(3) As Double
For i = 0 To SelPlatesNo-1
objOpenSTAAD.Property.GetPlateThickness(SelPlates(i) , PThickness)
pthk = CCur(PThickness(0))*1000
'Get a Plate Number
PlateNo= Join(Array(SelPlates(i)))
'Print Plate Number, Thickness and Node Nubers, ex) 123, 6 (395 17 864 863)
GetPlateNodeNo PlateNo, NodeA, NodeB, NodeC, NodeD
If NodeD = 0 Then :PlateData = PlateNo & ", " & pthk & " (" & NodeA & " " & NodeB & " " & NodeC & ")"
If NodeD <> 0 Then:PlateData = PlateNo & ", " & pthk & " (" & NodeA & " " & NodeB & " " & NodeC & " " & NodeD & ")"
'Debug.Print PlateData & vbCr
PlateData1 = PlateData1 + PlateData & vbCr
Next i
MsgBox PlateData1
End Sub
Sub GetPlateNodeNo(PlateNo As Long, ByRef NodeA As Long, ByRef NodeB As Long, ByRef NodeC As Long, ByRef NodeD As Long )
Dim objOpenSTAAD As Object
Set objOpenSTAAD = GetObject( , "StaadPro.OpenSTAAD")
objOpenSTAAD.Geometry.GetPlateIncidence PlateNo, NodeA, NodeB, NodeC, NodeD
End Sub