Delete



Your Ad Here

Syntax

SapObject.SapModel.LoadCases.Delete

VB6 Procedure

Function Delete(ByVal Name As String) As Long

Parameters

Name

The name of an existing load case.

Remarks

The function deletes the specified load case.

The function returns zero if the load case is successfully deleted, otherwise it returns a nonzero value.

The load case is not deleted and the function returns an error if the load case is assigned to an analysis case or if it is the only defined load case.

VBA Example

Sub DeleteLoadCase()
   'dimension variables
      
Dim SapObject As Sap2000.SapObject
      Dim SapModel As cSapModel
      Dim ret 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)

   'delete analysis case
   'Note:  ret in the above line returns 1, indicating an error.
   'This is the case because the load case DEAD is assigned to
   'analysis case DEAD. This is also the case because the load
   'case DEAD is the only load case defined.
      ret = SapModel.LoadCases.Delete("DEAD")

   'Note:  ret in the above line returns 1, indicating an error. This is the case because the load case DEAD is assigned to analysis case DEAD. This is also the case because the load case DEAD is the only load case defined.

   'close Sap2000
      SapObject.ApplicationExit False
      Set SapModel = Nothing
      Set SapObject = Nothing
End Sub

Release Notes

Initial release in version 11.00.

See Also

Return to SAP2000 Index


Your Ad Here