DigiPara Liftdesigner LDX API
Loading...
Searching...
No Matches
Change height and plane distance of head

API method: ILDXShaft5.SHAFT_MODE

Treename: Shaft0.

2 code examples follow.

Example 1: Change height and plane distance of head

 ' from Samples/Src/LDXAPIExamples/Example_LDXShaft.vb

    <APIHelpAttribute(APIHelpModes.FireCalcModel Or APIHelpModes.LoadLD3File, {APIHelpModes.InputParaLDXDoc}, "Shaft0.", "LDXShaft~SHAFT_MODE", "Change height and plane distance of head")>
 Public Shared Sub ChangeHeightAndPlaneDistanceOfHead(ByRef ldxDocument As DigiPara.LDX.LDXDocument)

     If ldxDocument.Shafts(0) Is Nothing Then
         MsgBox("Shafts not found!")
         Exit Sub
     End If

     With ldxDocument.Shafts(0)
         .Head = 5000
         .SHAFT_HEAD_PLANE_DZ = 555
         .SHAFT_MODE = .SHAFT_MODE Or DigiPara.LDX.ShaftModes.smManualHead Or DigiPara.LDX.ShaftModes.smShaftHeadPlaneManualDZ
     End With

 End Sub

Example 2: Custom shaft X positions

 ' from Samples/Src/LDXAPIExamples/Example_LDXShaft.vb

    <APIHelpAttribute(APIHelpModes.FireCalcModel Or APIHelpModes.LoadLD3File, {APIHelpModes.InputParaLDXDoc}, "Shaft2.SHAFT_MODE.", "LDXShaft~SHAFT_MODE", "Custom shaft X positions")>
 Public Shared Sub CustomShaftPositions(ByRef ldxDocument As DigiPara.LDX.LDXDocument)
     Dim shafts As DigiPara.LDX.LDXShafts = ldxDocument.Shafts

     If shafts.Count() > 1 Then
         ' remove existing shafts
         While shafts.Count() > 1
             shafts.Item(1).Object.RemoveMe()
         End While
         Exit Sub
     End If

     ' create four additional shafts
     shafts.Item(0).Object.CloneMe()
     shafts.Item(0).Object.CloneMe()
     shafts.Item(0).Object.CloneMe()
     shafts.Item(0).Object.CloneMe()

     ' set bank split after third shaft
     shafts.BANK_2_START_SX = 3

     ' get individual shafts
     Dim shaft3 As DigiPara.LDX.LDXShaft = shafts.Item(3)
     Dim shaft4 As DigiPara.LDX.LDXShaft = shafts.Item(4)

     ' set their X position to individual, remove group hole (keep all walls)
     shaft3.SHAFT_MODE = shaft3.SHAFT_MODE Or DigiPara.LDX.ShaftModes.smManualX0 Or DigiPara.LDX.ShaftModes.smDisableGroupHole
     shaft4.SHAFT_MODE = shaft4.SHAFT_MODE Or DigiPara.LDX.ShaftModes.smManualX0 Or DigiPara.LDX.ShaftModes.smDisableGroupHole

     ' make bank0 positions accurate
     ldxDocument.CalculateModel(DigiPara.LDX.CalculateModelModes.rcmCalc)

     ' take over X position from bank0 shafts; add width because the base point on bank2 shafts is on the right side
     shaft3.Room.X0 = shafts.Item(0).Room.X0 + shaft3.Room.Width
     shaft4.Room.X0 = shafts.Item(2).Room.X0 + shaft4.Room.Width

 End Sub