SapObject.SapModel.PointObj.CountLoadForce
Function CountLoadForce(ByRef Count As Long, Optional ByVal Name As String = "", Optional ByVal LoadCase As String = "") As Long
Count
The number of counted point loads.
Name
This optional item is the name of an existing point object.
LoadCase
This optional item is the name of an existing load case.
If neither the Name item nor the LoadCase item is provided, the Count item returns the total number of point load assignments in the model.
If the Name item is provided but not the LoadCase item, the Count item returns the total number of point load assignments made for the specified point object.
If the Name item is not provided but the LoadCase item is specified, the Count item returns the total number of point load assignments made to all point objects for the specified load case.
If both the Name item and the LoadCase item are provided,n the Count item returns the total number of point load assignments made to the specified point object for the specified load case.
If the Name item or the LoadCase item is provided but is not recognized by the program as valid, an error is returned.
This function returns zero if the count is successfully completed, otherwise it returns a nonzero value.
Sub CountPointLoads()
'dimension variables
Dim SapObject As Sap2000.SapObject
Dim SapModel As cSapModel
Dim ret As Long
Dim Value() As Double
Dim Count As Long
'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.New2DFrame(PortalFrame,
3, 124, 3, 200)
'add point load
Redim Value(5)
Value(0) = 10
ret = SapModel.PointObj.SetLoadForce("3",
"DEAD", Value)
'get number of point loads
ret = SapModel.PointObj.CountLoadForce(Count)
'close Sap2000
SapObject.ApplicationExit False
Set SapModel = Nothing
Set SapObject = Nothing
End Sub
Initial release in version 11.00.