Hello,
I'm fairly new at RAM DA and I was wondering how I could get a list of the stud counts for each beam in a model by feeding in the beam label.
Thanks!
Check the Ram DataAccess Developer's Guide (pdf). I think you are looking for GetSteelDesignResult, and GetNumStudsInSegments
ISteelBeamDesignResultThis interface represents the steel beam design results for an individual steel beam.GetNumStudsInSegments ([out, retval] DAArray** ppaINumStudsinSegments)Gets the collection of stud segments for the steel beam as an array of longs. Use the size of the array to determine the number of stud segments. Each value in the array represents the number of studs in that segment.
Thanks, Seth. I'm also working on retrieving stud counts through RAM Data Access using VBA. I'm having trouble with the GetNumStudsInSegments method and the simple methods in the DAArray interface such as GetSize. I noticed that the portion of the code in "DA Model Merge and Move" that retrieves stud counts is commented out with the note that "studs seem to be broken in v14.06.01". Here's an example of what I'm running into in an otherwise working VBA project:
Dim ISteelBeamDesignResult As RAMDATAACCESSLib.ISteelBeamDesignResult
Dim studSegments As RAMDATAACCESSLib.DAArray
Dim numSegments As Long
Dim numBeams As Integer
Set IBeams = IStory.GetBeamsnumBeams = IBeams.GetCount
For B = 0 To numBeams - 1
Set IBeam = IBeams.GetAt(B)
Set ISteelBeamDesignResult = IBeam.GetSteelDesignResult
Set studSegments = ISteelBeamDesignResult.GetNumStudsInSegments
numSegments = studSegments.GetSize
Next ‘Beam in numBeams
Gives the following compile error for studSegments.GetSize method: "Argument not optional".
I'm having similar issues with the .GetAt method. Do you have any suggestions? Much appreciated!
Take a look at this snippet demonstrating getting and setting studs.
'''''''''''''''''' 'How to get studs' '''''''''''''''''' Dim StudArray As RAMDATAACCESSLib.DAArray 'Before calling this method, make sure the beam is a valid composite beam '1 - steel, smartbeam, or westok material only '2 - not lateral '3 - was designed as composite Set StudArray = IBeam.GetSteelDesignResult.GetNumStudsInSegments Dim i As Long Dim lStudSegmentCount As Variant Dim lSize As Long StudArray.GetSize lSize 'loop through each beam segment with studs and add 1 additional stud to the array For i = 0 To lSize - 1 'This is how you get the stud count on a segment StudArray.GetAt i, lStudSegmentCount 'This is how you change the value of a DAArray StudArray.SetAt i, lStudSegmentCount + 1 Next 'set stud array IBeam.GetSteelDesignResult.SetNumStudsInSegments StudArray 'freeze IBeam.EAnalyzeFlag = eAnalyze
Thanks, Eric! That did the trick.