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