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

API method: ILDXHallButton5.HBMode

Treename: Shaft0.Entries1.E0.Panel0.

4 code examples follow.

Example 1: Change properties

 ' from Samples/Src/LDXAPIExamples/Example_LDXHallButton.vb

    <APIHelpAttribute(APIHelpModes.FireCalcModel Or APIHelpModes.LoadLD3File, {APIHelpModes.InputParaLDXDoc}, "Shaft0.Entries1.E0.Panel0.", "LDXHallButton~HBMode", "Change properties")>
    Public Shared Sub ChangeProperties(ByRef ldxDocument As DigiPara.LDX.LDXDocument)

        If ldxDocument.GetLDXObject("Shaft0.Entries1.E0.Panel0.") Is Nothing Then
            MsgBox("Desired hall button protection not found! Please reload the relevant .ld3 file.")
            Exit Sub
        End If

        Dim ldxEntry As DigiPara.LDX.LDXEntry = DirectCast(ldxDocument.GetLDXObject("Shaft0.Entries1.E0.").LDXType, DigiPara.LDX.LDXEntry)
        Dim ldxHallButton As DigiPara.LDX.LDXHallButton = ldxEntry.GetHallButton(0)

        With ldxHallButton
            ' Set button relative to wall opening
            .HBMode = (.HBMode Or DigiPara.LDX.HallButtonModes.hbmXreltoRoughOpening) And Not DigiPara.LDX.HallButtonModes.hbmXreltoDoorWidth
            ' Position button in right wall
            .HBPosition = .HBPosition Or DigiPara.LDX.HallButtonPositionModes.hbpmRight
            ' The sideways displacement of button
            .X0 = 111
            ' Elevation of button from bottom of floor level
            .DZ0 = 1111
            ' Wall opening clearances of button
            .WALL_OPENING_CLR_ABOVE = 55
            .WALL_OPENING_CLR_RIGHT = 55
            .WALL_OPENING_CLR_BELOW = 55
            .WALL_OPENING_CLR_LEFT = 55
            .WALL_OPENING_CLR_BEHIND = 0
            ' The settings of hole behind the hall button
            ' Sideways displacement 
            .HOLE_DX0 = 11
            ' Upwards displacement
            .HOLE_DZ0 = -222
            ' Height
            .HOLE_HEIGHT = 777
            ' Width
            .HOLE_WIDTH = 222
            ' Make the other hole rectangular
            .Comp.Holes(1).HoleMode = .Comp.Holes(1).HoleMode And Not DigiPara.LDX.HoleModes.hmCylinder
        End With

    End Sub

Example 2: Angled Drill Holes

 ' from Samples/Src/LDXAPIExamples/Example_LDXHallButton.vb

    <APIHelpAttribute(APIHelpModes.FireCalcModel Or APIHelpModes.LoadLD3File, {APIHelpModes.InputParaLDXDoc}, "Shaft0.Entries1.E0.Panel0.Hole0.", "LDXHallButton~HBMode", "Angled Drill Holes")>
 Public Shared Sub AngledDrillHoles(ByRef ldxDocument As DigiPara.LDX.LDXDocument)      ' get plan view
     Helpers.EnsurePlanView(ldxDocument, DigiPara.LDX.SheetFrameProductGroups.shfpHallButtons)

     ' get second shaft with dividing wall
     If ldxDocument.Shafts.Count < 2 Then
         Dim shaft = ldxDocument.Shafts.Item(0)
         shaft.SHAFT_MODE = shaft.SHAFT_MODE Or DigiPara.LDX.ShaftModes.smDisableGroupHole
         shaft.Object.CloneMe()
     End If

     If ldxDocument.GetLDXObject("Shaft0.Entries1.E0.Panel0.") Is Nothing Then
         MsgBox("Desired hall button protection not found! Please reload the relevant .ld3 file.")
         Exit Sub
     End If

     Dim ldxEntry As DigiPara.LDX.LDXEntry = DirectCast(ldxDocument.GetLDXObject("Shaft0.Entries1.E0.").LDXType, DigiPara.LDX.LDXEntry)
     Dim ldxHallButton As DigiPara.LDX.LDXHallButton = ldxEntry.GetHallButton(0)

     With ldxHallButton
         .X0 = 100 ' only a slight displacement by default
         .HBMode = (.HBMode And Not DigiPara.LDX.HallButtonModes.hbmXPosMask) Or DigiPara.LDX.HallButtonModes.hbmXreltoShaftWidth ' place in wall
         .HBDatabaseMode = .HBDatabaseMode Or DigiPara.LDX.HallButtonDatabaseModes.hbdmDrillHolePositionIsRelativeToCenter ' drill hole positions are relative to center
         .HBPosition = DigiPara.LDX.HallButtonPositionModes.hbpmRight Or DigiPara.LDX.HallButtonPositionModes.hbpmWall ' to the right
         .WALL_OPENING_CLR_BEHIND = 20 ' shrink Hole0 so drill holes are required

         ' set angles (required for this position so the holes can reach their shafts by 30 degrees
         .Comp.Holes.GetByObjectPrefix("DrillHole1").Comp.AlphaRad = -Math.PI / 6
         .Comp.Holes.GetByObjectPrefix("DrillHole2").Comp.AlphaRad = +Math.PI / 6
         ' the holes will be extended long enough that they do reach the shaft. DrillHole1 will always go to the relative left shaft, 
         ' DrillHole2 to the right, so the angles should always have the signs they have above

         Select Case .HBDatabaseMode And DigiPara.LDX.HallButtonDatabaseModes.hbdmDrillHoleNumberMask
             Case DigiPara.LDX.HallButtonDatabaseModes.hbdmNone, DigiPara.LDX.HallButtonDatabaseModes.hbdmDrillHoleNumberOne, DigiPara.LDX.HallButtonDatabaseModes.hbdmDrillHoleNumberTwo
                 ' disable holes manually
                 .HBDatabaseMode = (.HBDatabaseMode And Not DigiPara.LDX.HallButtonDatabaseModes.hbdmDrillHoleNumberMask) Or DigiPara.LDX.HallButtonDatabaseModes.hbdmDrillHolNumberCustom Or DigiPara.LDX.HallButtonDatabaseModes.hbdmDrillHoleNumberNone

             Case DigiPara.LDX.HallButtonDatabaseModes.hbdmDrillHolNumberCustom Or DigiPara.LDX.HallButtonDatabaseModes.hbdmDrillHoleNumberNone
                 ' enable one straight hole
                 .HBDatabaseMode = (.HBDatabaseMode And Not DigiPara.LDX.HallButtonDatabaseModes.hbdmDrillHoleNumberMask) Or DigiPara.LDX.HallButtonDatabaseModes.hbdmDrillHolNumberCustom Or DigiPara.LDX.HallButtonDatabaseModes.hbdmDrillHoleNumberOne
                 .HOLE1_DX0 = -50

             Case DigiPara.LDX.HallButtonDatabaseModes.hbdmDrillHolNumberCustom Or DigiPara.LDX.HallButtonDatabaseModes.hbdmDrillHoleNumberOne
                 ' enable two holes
                 .HBDatabaseMode = (.HBDatabaseMode And Not DigiPara.LDX.HallButtonDatabaseModes.hbdmDrillHoleNumberMask) Or DigiPara.LDX.HallButtonDatabaseModes.hbdmDrillHolNumberCustom Or DigiPara.LDX.HallButtonDatabaseModes.hbdmDrillHoleNumberTwo
                 .HOLE1_DX0 = -50
                 .HOLE2_DX0 = 50

             Case DigiPara.LDX.HallButtonDatabaseModes.hbdmDrillHolNumberCustom Or DigiPara.LDX.HallButtonDatabaseModes.hbdmDrillHoleNumberTwo
                 ' back to automatism
                 .HBDatabaseMode = (.HBDatabaseMode And Not DigiPara.LDX.HallButtonDatabaseModes.hbdmDrillHoleNumberMask)

             Case Else
                 ' back to automatism
                 .HBDatabaseMode = (.HBDatabaseMode And Not DigiPara.LDX.HallButtonDatabaseModes.hbdmDrillHoleNumberMask)

         End Select
     End With

 End Sub

Example 3: X Positioning Modes

 ' from Samples/Src/LDXAPIExamples/Example_LDXHallButton.vb

    <APIHelpAttribute(APIHelpModes.FireCalcModel Or APIHelpModes.LoadLD3File, {APIHelpModes.InputParaLDXDoc}, "Shaft0.Entries1.E0.Panel0.", "LDXHallButton~HBMode", "X Positioning Modes")>
 Public Shared Sub CycleXPosition(ByRef ldxDocument As DigiPara.LDX.LDXDocument)
     ' get plan view
     Helpers.EnsurePlanView(ldxDocument, DigiPara.LDX.SheetFrameProductGroups.shfpHallButtons)

     ' get second shaft
     If ldxDocument.Shafts.Count < 2 Then
         ldxDocument.Shafts.Item(0).Object.CloneMe()
     End If

     If ldxDocument.GetLDXObject("Shaft0.Entries1.E0.Panel0.") Is Nothing Then
         MsgBox("Desired hall button protection not found! Please reload the relevant .ld3 file.")
         Exit Sub
     End If

     Dim ldxEntry As DigiPara.LDX.LDXEntry = DirectCast(ldxDocument.GetLDXObject("Shaft0.Entries1.E0.").LDXType, DigiPara.LDX.LDXEntry)
     Dim ldxHallButton As DigiPara.LDX.LDXHallButton = ldxEntry.GetHallButton(0)

     With ldxHallButton
         .X0 = 100
         ' cycle through modes
         Dim targetMode As DigiPara.LDX.HallButtonModes = DigiPara.LDX.HallButtonModes.hbmNone
         Select Case .HBMode And DigiPara.LDX.HallButtonModes.hbmXPosMask
             Case DigiPara.LDX.HallButtonModes.hbmXreltoDoorWidth
                 ' place button next to jamb
                 targetMode = DigiPara.LDX.HallButtonModes.hbmXreltoJamb
             Case DigiPara.LDX.HallButtonModes.hbmXreltoJamb
                 ' place button next to wall opening
                 targetMode = DigiPara.LDX.HallButtonModes.hbmXreltoRoughOpening
             Case DigiPara.LDX.HallButtonModes.hbmXreltoRoughOpening
                 ' place button relative to center of the door
                 targetMode = DigiPara.LDX.HallButtonModes.hbmXreltoDoorCenter
                 ' this does not make much sense for this button, so move it
                 .X0 = -1000
             Case DigiPara.LDX.HallButtonModes.hbmXreltoDoorCenter
                 ' place button at the shaft wall
                 targetMode = DigiPara.LDX.HallButtonModes.hbmXreltoShaftWidth
                 .X0 = 0
             Case DigiPara.LDX.HallButtonModes.hbmXreltoShaftWidth
                 ' center button between this shaft's door and the next shaft's door
                 targetMode = DigiPara.LDX.HallButtonModes.hbmXCenterDoor2Door
                 .X0 = 999999 ' X0 is irrelevant here
             Case Else
                 ' place button directly next to door
                 targetMode = DigiPara.LDX.HallButtonModes.hbmXreltoDoorWidth
         End Select
         .HBMode = (.HBMode And Not DigiPara.LDX.HallButtonModes.hbmXPosMask) Or targetMode
     End With

 End Sub

Example 4: Change grouping

 ' from Samples/Src/LDXAPIExamples/Example_LDXHallButton.vb

    <APIHelpAttribute(APIHelpModes.FireCalcModel Or APIHelpModes.LoadLD3File, {APIHelpModes.InputParaLDXDoc}, "Shaft0.Entries1.E2.Panel0.", "LDXHallButton~HBMode", "Change grouping")>
 Public Shared Sub ChangeGrouping(ByRef ldxDocument As DigiPara.LDX.LDXDocument)

     If ldxDocument.GetLDXObject("Shaft0.Entries1.E2.Panel0.") Is Nothing Then
         MsgBox("Desired hall button protection not found! Please reload the relevant .ld3 file.")
         Exit Sub
     End If

     Dim ldxEntry As DigiPara.LDX.LDXEntry = DirectCast(ldxDocument.GetLDXObject("Shaft0.Entries1.E2.").LDXType, DigiPara.LDX.LDXEntry)
     Dim ldxHallButton As DigiPara.LDX.LDXHallButton = ldxEntry.GetHallButton(0)

     Helpers.EnsureVerticalView(ldxDocument, ldxHallButton.Comp)

     With ldxHallButton
         ' Toggle type grouping flag
         .HBMode = .HBMode Xor DigiPara.LDX.HallButtonModes.hbmTypeManual
         ' NOTE: A current weird quirk is that if you give the hall button a RID that differs from the others, it will be considered
         ' to be of manual type as well. We consider this a bug and will change it so that hbmTypeManual will be required.

         ' change some properties
         With .HallButtonTab
             .SetValue("TB_DESC", "CUSTOM TYPE")
             .SetValue("TB_DX", 500)
             .SetValue("TB_DX_BOX", 400)
         End With

         ' send change notification to other hall button to sync (or not) settings to this hall button
         ldxDocument.GetLDXObject("Shaft0.Entries1.E1.Panel0.").SendChangeNotification("", "")
     End With

 End Sub