DigiPara Liftdesigner LDX API
Loading...
Searching...
No Matches
Change fixing

API method: ILDXLadder5.Mode

Treename: Shaft0.Ladder.

2 code examples follow.

Example 1: Fix ladder at separator beam

 ' from Samples/Src/LDXAPIExamples/Example_LDXLadder.vb

    <APIHelpAttribute(APIHelpModes.FireCalcModel Or APIHelpModes.LoadLD3File, {APIHelpModes.InputParaLDXDoc}, "Shaft0.Ladder.", "LDXLadder~Mode", "Fix ladder at separator beam")>
 Public Shared Sub ChangeMode(ByRef ldxDocument As DigiPara.LDX.LDXDocument)

     If ldxDocument.GetObject("Shaft0.Ladder.") Is Nothing Then
         MsgBox("Ladder not found!")
         Exit Sub
     End If

     Dim shaft As DigiPara.LDX.LDXShaft = ldxDocument.Shafts(0)
     With shaft.Ladder
         ' change to ladder with all the new features
         If .Comp.RID64 <> 6 Then
             .Comp.ChangePartRID64(6, 0)
         End If

         .Comp.Wall = shaft.CWConsole.Comp.Wall

         If (.Mode And DigiPara.LDX.LadderModes.lmFixedAtOwnBeam) = DigiPara.LDX.LadderModes.lmFixedAtOwnBeam Then
             ' enable fixing at existing separator beams
             .LadderTab.SetValue("LT_DESC", "Fix at existing beams from rail bracket list")
             .Mode = (.Mode And Not DigiPara.LDX.LadderModes.lmFixedAtOwnBeam) Or DigiPara.LDX.LadderModes.lmFixAtSeparatorBeam

             ' enable separator beams
             With shaft.Console(.Comp.Wall)?.RailBrackets
                 .RBL_MODE = .RBL_MODE Or DigiPara.LDX.RailBracketsModes.rbmSeparatorBeam Or DigiPara.LDX.RailBracketsModes.rbmFixTypeSteel
             End With
         ElseIf (.Mode And DigiPara.LDX.LadderModes.lmFixAtSeparatorBeam) = DigiPara.LDX.LadderModes.lmFixAtSeparatorBeam Then
             ' disable fixing at separator beams
             .LadderTab.SetValue("LT_DESC", "Fixed directly at wall")
             .Mode = .Mode And Not DigiPara.LDX.LadderModes.lmFixedAtOwnBeam And Not DigiPara.LDX.LadderModes.lmFixAtSeparatorBeam

             ' disable separator beams
             With shaft.Console(.Comp.Wall)?.RailBrackets
                 .RBL_MODE = .RBL_MODE And Not DigiPara.LDX.RailBracketsModes.rbmSeparatorBeam
             End With
         Else ' no separator beam set
             ' enable fixing at own separator beam
             .LadderTab.SetValue("LT_DESC", "Fix at own separator beams")
             .Mode = .Mode Or DigiPara.LDX.LadderModes.lmFixedAtOwnBeam

             ' disable separator beams
             With shaft.Console(.Comp.Wall)?.RailBrackets
                 .RBL_MODE = .RBL_MODE And Not DigiPara.LDX.RailBracketsModes.rbmSeparatorBeam
             End With
         End If
     End With

     EnsureLadderViews(ldxDocument)
 End Sub

Example 2: Build custom ladder

 ' from Samples/Src/LDXAPIExamples/Example_LDXLadder.vb

    <APIHelpAttribute(APIHelpModes.FireCalcModel Or APIHelpModes.LoadLD3File, {APIHelpModes.InputParaLDXDoc}, "Shaft0.Ladder.", "LDXLadder~Mode", "Build custom ladder")>
 Public Shared Sub SetupCustomSteps(ByRef ldxDocument As DigiPara.LDX.LDXDocument)

     If ldxDocument.GetObject("Shaft0.Ladder.") Is Nothing Then
         MsgBox("Ladder not found!")
         Exit Sub
     End If

     Dim shaft As DigiPara.LDX.LDXShaft = ldxDocument.Shafts(0)
     With shaft.Ladder
         If .Comp.RID64 <> 1 Then
             ' back to old standard ladder
             .Comp.ChangePartRID64(1, 0)
         Else
             With .Comp
                 ' clean slate
                 .ChangePartRID64(2, 0)
                 While .Profiles.Count > 0
                     .Profiles.RemoveAt(0)
                 End While

                 ' make side shafts
                 For i As Integer = -1 To 1 Step 2
                     With .Profiles.Add()
                         .TYP = ProfileType.prtQ
                         .SetEquation(DirectCast(DigiPara.LDX.ProfileEquationType.peqtL, Integer), "30")
                         .SetEquation(DirectCast(DigiPara.LDX.ProfileEquationType.peqtH, Integer), "2*[8] + [10]") ' STEP_START + STEP_TOTAL
                         .SetEquation(DirectCast(DigiPara.LDX.ProfileEquationType.peqtB, Integer), "80")
                         .SetEquation(DirectCast(DigiPara.LDX.ProfileEquationType.peqtLocalPositionX, Integer), $"{i * 0.5}*[0]") ' B
                         .SetEquation(DirectCast(DigiPara.LDX.ProfileEquationType.peqtLocalPositionY, Integer), "-0.5*[98]") ' PDY
                         .SetEquation(DirectCast(DigiPara.LDX.ProfileEquationType.peqtLocalPositionZ, Integer), "0.5*[96]") ' PDZ
                     End With
                 Next

                 ' make rung; rungs are replicated at appropriate z positions from PGT_RID -1
                 With .Profiles.Add()
                     .PGT_RID = -1
                     .SetEquation(DirectCast(DigiPara.LDX.ProfileEquationType.peqtL, Integer), "[0]") 'B
                     .SetEquation(DirectCast(DigiPara.LDX.ProfileEquationType.peqtH, Integer), "20")
                     .SetEquation(DirectCast(DigiPara.LDX.ProfileEquationType.peqtB, Integer), "80")
                     .SetEquation(DirectCast(DigiPara.LDX.ProfileEquationType.peqtLocalPositionY, Integer), "-0.5*[98]") ' PDY
                 End With

                 ' make fixings; they are defined by PGT_RID -2 to -4.
                 For i As Integer = 1 To 3
                     For j As Integer = -1 To 1 Step 2
                         With .Profiles.Add()
                             .TYP = ProfileType.prtQ
                             .PGT_RID = -1 - i
                             .SetEquation(DirectCast(DigiPara.LDX.ProfileEquationType.peqtL, Integer), "20")
                             .SetEquation(DirectCast(DigiPara.LDX.ProfileEquationType.peqtH, Integer), "100")
                             .SetEquation(DirectCast(DigiPara.LDX.ProfileEquationType.peqtB, Integer), "[2]") ' T, distance to wall
                             .SetEquation(DirectCast(DigiPara.LDX.ProfileEquationType.peqtLocalPositionX, Integer), $"{j * 20} + {j * 0.5}*[0]") ' B
                             .SetEquation(DirectCast(DigiPara.LDX.ProfileEquationType.peqtLocalPositionY, Integer), "-0.5*[98]") ' PDY
                             .SetEquation(DirectCast(DigiPara.LDX.ProfileEquationType.peqtLocalPositionZ, Integer), $"0.5*[96] + [{i + 10}]") ' PDZ, FIXING_i_HEIGHT
                         End With
                     Next
                 Next

             End With

             ' Activate custom geometry by profile group with fixings activated
             .Mode = .Mode Or LadderModes.lmDoNotDrawDefault Or LadderModes.lmCustomStepsSupport Or LadderModes.lmFixedAtOwnBeam
             ' we don't activate the separator beams themselves, though, that could happen over .SeparatorBeam

             ' Set steps
             .STEP_COUNT = 5
             .STEP_DIST = 300
             .STEP_START = 150

             ' set width
             .B = 400

             ' activate only two of the fixings
             .FIXING_COUNT = 2

             ' position fixings
             .FIXING_HEIGHT(1) = 10 ' Bottom fixing should get index 1
             .FIXING_HEIGHT(0) = .FIXING_HEIGHT(1) + .STEP_DIST * 4 ' top fixing gets index 0 so it is activated first
             .FIXING_HEIGHT(2) = .FIXING_HEIGHT(1) + .STEP_DIST * 2 ' middle fixing in case user activates it

             ' set distance to wall
             .T = 140

             .LadderTab.SetValue("LT_DESC", "Ladder built from custom profile group")
         End If
     End With

     EnsureLadderViews(ldxDocument)
 End Sub