SapObject.SapModel.SolidObj.GetElm
Function GetElm(ByVal Name As String, ByRef nelm As Long, ByRef Elm() as String) As Long
Name
The name of an existing solid object.
nelm
The number of solid elements created from the specified solid object.
Elm
An array that includes the name of a solid element created from the specified solid object.
This function retrieves the names of the solid elements (analysis model solid) associated with a specified solid object in the object-based model.
This function returns zero if the solid element information is successfully returned; otherwise it returns nonzero. An error occurs if the analysis model does not exist.
Sub GetSolidElementInfoForSolidObject()
'dimension variables
Dim SapObject As Sap2000.SapObject
Dim SapModel As cSapModel
Dim ret As Long
Dim nelm As Long
Dim Elm() 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 information
ret = SapModel.SolidObj.GetElm("1",
nelm, Elm)
'close Sap2000
SapObject.ApplicationExit False
Set SapModel = Nothing
Set SapObject = Nothing
End Sub
Initial release in version 11.00.