Applies To | |||
Product(s): | STAAD.Pro | ||
Version(s): | All | ||
Environment: | N/A | ||
Area: | OpenSTAAD | ||
Subarea: | Geometry | ||
Original Author: | Bentley Technical Support Group, Shreyanka Bhattacharjee | ||
Problem Description:
How to renumber all members using OpenSTAAD functions (VBA)
Solution:
You may use function RenumberBeam to renumber the existing beam ID with the specified ID.
Function GetMemberCount and GetBeamList is used to extract the member number information.
Parameter for function RenumberBeam
[Input] oldbeam: Old beam ID
[Input] newbeam: New beam ID
VBA script:
Sub RenumberAllBeam()
Dim beamcount As Long
Dim oldbeam() As Long
Dim newbeam() As Long
Dim newbeamStartNo As Long
newbeamStartNo = 400 'Starting Numbering from
Set objOpenStaad = GetObject(, "StaadPro.OpenSTAAD")
beamcount = objOpenStaad.Geometry.GetMemberCount
ReDim oldbeam(beamcount - 1)
ReDim newbeam(beamcount - 1)
objOpenStaad.Geometry.GetBeamList oldbeam
For i = 0 To beamcount - 1
newbeam(i) = newbeamStartNo + i
objOpenStaad.Geometry.RenumberBeam oldbeam(i), newbeam(i)
Next i
End Sub
Output:
The actual member numbers of the structure is from 1 to 325. Here I have renumbered the member in such a way that the first member number will be 400 and last member number will be 724. Please refer to the attached video, Renumber Beam.mp4.
I have attached the STAAD model (Structure2.STD)
communities.bentley.com/.../Structure2.STD