Get a list of Property name

Hi

Could anyone help me on this one?

Openstaad macro in excel.

Im trying to get the list of profile used.

Thanks.

Parents
  • I successfully run the macro. If ever anyone would want to use.

    You can use this code

     'Get list of profiles used
        profiles = objOpenSTAAD.Property.GetSectionPropertyCount()
        Cells(4, 2).Value = profiles
       
        Dim refNo As Long
        Dim profname As String
       
       For i = 0 To profiles
       refNo = i
       objOpenSTAAD.Property.GetSectionPropertyName refNo, profname
       Cells(i + 5, 2).Value = profname
        Next i
        
        Cells(1, 1).Select

    Answer Verified By: Dave Jason Narca 

  • Dim lMemberNo As Long
    Dim lNodeA As Long
    Dim lNodeB As Long

    Dim icount As Integer

    Dim dCoordX As Double
    Dim dCoordY As Double
    Dim dCoordZ As Double

    Dim SelBeams() As Long

    Dim strpropertyname As Variant
    Dim isecrefno As String
    Dim dWidth As Double
    Dim dDepth As Double
    Dim dax As Double
    Dim Day As Double
    Dim daz As Double
    Dim dix As Double
    Dim diy As Double
    Dim diz As Double
    Dim dtf As Double
    Dim dtw As Double

    Set objopenstaad = GetObject(, "StaadPro.OpenSTAAD")

    Dim NoOfSelectedBeams As Long
    NoOfSelectedBeams = objopenstaad.Geometry.GetNoOfSelectedBeams

    If NoOfSelectedBeams = 0 Then

    MsgBox "No Columns Selected ! Aborting...."

    Exit Sub

    End If

    ReDim SelBeams(NoOfSelectedBeams - 1) As Long

    objopenstaad.Geometry.GetSelectedBeams SelBeams, 1


    For icount = 0 To (NoOfSelectedBeams - 1)

    lMemberNo = SelBeams(icount)

    objopenstaad.Geometry.GetMemberIncidence lMemberNo, lNodeA, lNodeB

    Cells(2 + icount, 1).Value = lMemberNo

    objopenstaad.Geometry.GetNodeCoordinates lNodeA, dCoordX, dCoordY, dCoordZ

    Cells(2 + icount, 2).Value = lNodeA
    Cells(2 + icount, 3).Value = dCoordX
    Cells(2 + icount, 4).Value = dCoordY
    Cells(2 + icount, 5).Value = dCoordZ

    objopenstaad.Geometry.GetNodeCoordinates lNodeB, dCoordX, dCoordY, dCoordZ

    Cells(2 + icount, 6).Value = lNodeB
    Cells(2 + icount, 7).Value = dCoordX
    Cells(2 + icount, 8).Value = dCoordY
    Cells(2 + icount, 9).Value = dCoordZ

    objopenstaad.Property.GetSectionPropertyName strpropertyname, isecrefno

    Cells(2 + icount, 10).Value = strpropertyname
    Cells(2 + icount, 11).Value = isecrefno

    objopenstaad.Property.GetBeamPropertyAll dWidth, dDepth, dax, Day, daz, dix, diy, diz, dtf, dtw

    Cells(2 + icount, 12).Value = dWidth
    Cells(2 + icount, 13).Value = dDepth
    Cells(2 + icount, 14).Value = dax
    Cells(2 + icount, 15).Value = Day
    Cells(2 + icount, 16).Value = daz
    Cells(2 + icount, 17).Value = dix
    Cells(2 + icount, 18).Value = diy
    Cells(2 + icount, 19).Value = diz
    Cells(2 + icount, 20).Value = dtf
    Cells(2 + icount, 21).Value = dtw

    Next

    Set staad = Nothing
    End Sub

    i wrote this code to get the necessary values but the property name followed by beam property coming null.

Reply Children
No Data