cSapModelSetModelIsLocked Method

Locks or unlocks the model.

Namespace:  ETABS2016
Assembly:  ETABS2016 (in ETABS2016.dll) Version: 16.0.0.0 (16.0.0.0)
Syntax
int SetModelIsLocked(
	bool Lockit
)

Parameters

Lockit
Type: SystemBoolean
The item is True if the model is to be locked and False if it is to be unlocked.

Return Value

Type: Int32
Returns zero if the locked status of the model is successfully set. Otherwise it returns a nonzero value.
Remarks
With some exceptions, definitions and assignments can not be changed in a model while the model is locked. If an attempt is made to change a definition or assignment while the model is locked and that change is not allowed in a locked model, an error will be returned.
Examples
VB
Public Sub Example()
       Dim SapModel As cSapModel
       Dim EtabsObject As cOAPI
       Dim ret As Integer = -1

   'create ETABS object
       EtabsObject = CreateObject("CSI.ETABS.API.ETABSObject")

   'start ETABS application
       ret = EtabsObject.ApplicationStart()

   'create SapModel object
       SapModel = EtabsObject.SapModel

   'initialize model
       ret = SapModel.InitializeNewModel()

   'create steel deck template model
       ret = SapModel.File.NewSteelDeck(4,12,12,4,4,24,24)

   'Lock model
       ret = SapModel.SetModelIsLocked(True)

   'close ETABS
       EtabsObject.ApplicationExit(False)

   'clean up variables
       SapModel = Nothing
       EtabsObject = Nothing
   End Sub
See Also