Can someone point me to an example of reading/writing Bentley Structral V8i parts? I don't see any examples delivered.

I have been asked to write a macro for Bentley Structural to change the property of some parts.  Does someone have an example they can share or point me to where an example might be?

Parents
  • Search the Structural Detailing forum, there are some threads there about Structural vba. There was also a Structural VBA help file, but danged if I can find it now. I must have lost it when I updated Structural. Also take a look at the structural spreadsheet that was delivered with the program. It will let you query members, make changes to certain attributes, then save the changes back to the model. If that is not enough for your needs, the vba modules for that spreadsheet are a goldmine of existing code on how to interact with Structural members....

    Microstation SS3 08.11.09.714

    ProStructures V8i SS8 v8.11.14.238

  • I found an MVBA snippet written by myself serveral years ago. This subrountine creates a structural member from within Bentley Structual. For your reference.

    Sub CreateAMember(pPt As Point3d, qPt As Point3d, mySectionName As String)
        Dim myMember As STFLinearMember
        Dim section As STFSection
        Set myMember = New STFLinearMemberList
        Set section = New STFSectionList
        section.SetName mySectionName
        myMember.SetSTFSection section
        myMember.SetPartFamily "Steel"
        myMember.SetPartName "Beams and Columns"
        myMember.SetMaterial "Steel", "Q345B"
        myMember.SetPQPoints pPt, qPt
        myMember.SetPlacementPoint 5
        myMember.SetRotation 0#
        myMember.SetCrossSectionReflection True
        myMember.CreateTFFormRecipeList
        myMember.Save True
    End Sub



Reply
  • I found an MVBA snippet written by myself serveral years ago. This subrountine creates a structural member from within Bentley Structual. For your reference.

    Sub CreateAMember(pPt As Point3d, qPt As Point3d, mySectionName As String)
        Dim myMember As STFLinearMember
        Dim section As STFSection
        Set myMember = New STFLinearMemberList
        Set section = New STFSectionList
        section.SetName mySectionName
        myMember.SetSTFSection section
        myMember.SetPartFamily "Steel"
        myMember.SetPartName "Beams and Columns"
        myMember.SetMaterial "Steel", "Q345B"
        myMember.SetPQPoints pPt, qPt
        myMember.SetPlacementPoint 5
        myMember.SetRotation 0#
        myMember.SetCrossSectionReflection True
        myMember.CreateTFFormRecipeList
        myMember.Save True
    End Sub



Children