Sap2000.SolidElm.GetNameList
Function GetNameList(ByRef NumberNames As Long, ByRef MyName() As String) As Long
NumberNames
The number of solid element names retrieved by the program.
MyName
This is a one-dimensional array of solid element names. The MyName array is created as a dynamic, zero-based, array by the API user:
Dim MyName() as String
The array is dimensioned to (NumberNames – 1) inside the SAP2000 program, filled with the names, and returned to the API user.
This function retrieves the names of all defined solid elements.
The function returns zero if the names are successfully retrieved; otherwise it returns nonzero.
Sub GetSolidElementNames()
'dimension variables
Dim SapObject As Sap2000.SapObject
Dim SapModel As cSapModel
Dim ret As Long
Dim NumberNames As Long
Dim MyName() As String
'create Sap2000 object
Set SapObject = New SAP2000.SapObject
'start Sap2000 application
SapObject.ApplicationStart
'create SapModel object
Set SapModel = SapObject.SapModel
'initialize model
ret = SapModel.InitializeNewModel
'create model from template
ret = SapModel.File.NewSolidBlock(300, 400, 200, , , 2, 2, 2)
'create the analysis model
ret = SapModel.Analyze.CreateAnalysisModel
'get solid element names
ret = SapModel.SolidElm.GetNameList(NumberNames, MyName)
'close Sap2000
SapObject.ApplicationExit False
Set SapModel = Nothing
Set SapObject = Nothing
End Sub
Initial release in version 11.00.