DigiPara Liftdesigner LDX API
Loading...
Searching...
No Matches
Take over holes

API method: ILDXHole5.HoleMode

Treename: Shaft0.MachineryRoom.Door.Hole0.

3 code examples follow.

Example 1: Take over hole and position by X0

 ' from Samples/Src/LDXAPIExamples/Example_LDXHole.vb

    <APIHelpAttribute(APIHelpModes.FireCalcModel Or APIHelpModes.LoadLD3File, {APIHelpModes.InputParaLDXDoc}, "Shaft0.MachineryRoom.Door.Hole0.", "LDXHole~HoleMode", "Take over hole and position by X0")>
 Public Shared Sub PositionByX0(ByRef ldxDocument As DigiPara.LDX.LDXDocument)

     Dim o As DigiPara.LDX.LDXObject = ldxDocument.GetLDXObject("Shaft0.MachineryRoom.Door.Hole0.")
     If o Is Nothing Then
         MsgBox("Desired hole not found. Please reload the relevant .ld3 file.")
         Exit Sub
     End If
     Dim hole As DigiPara.LDX.LDXHole = DirectCast(o.GetLDXType(ObjectId.idHole), LDXHole)

     MakeVisible(ldxDocument, hole.Object.ParentObject.Comp)
     MakeVisible(ldxDocument, hole.Comp)

     With hole
         ' some holes are, like additional holes, positioned over the X/Y/Z0/1 coordinates.
         ' to take them over, we just have to enable the hmDisableInternalRules flag.
         .HoleMode = .HoleMode Xor HoleModes.hmDisableInternalRules

         ' just in case PositionByX1 ran
         .HoleMode = .HoleMode And Not HoleModes.hmPosiByX1

         If (.HoleMode And HoleModes.hmDisableInternalRules) = HoleModes.hmNone Then
             Return ' we just reset everything to defaults
         End If

         ' set position and size
         .X0 = 0
         .DX = .DX * 2
         ' For other holes, you may need to set .X1 instead by default
     End With
 End Sub

Example 2: Take over hole and position by X1

 ' from Samples/Src/LDXAPIExamples/Example_LDXHole.vb

    <APIHelpAttribute(APIHelpModes.FireCalcModel Or APIHelpModes.LoadLD3File, {APIHelpModes.InputParaLDXDoc}, "Shaft0.MachineryRoom.Door.Hole0.", "LDXHole~HoleMode", "Take over hole and position by X1")>
 Public Shared Sub PositionByX1(ByRef ldxDocument As DigiPara.LDX.LDXDocument)

     Dim o As DigiPara.LDX.LDXObject = ldxDocument.GetLDXObject("Shaft0.MachineryRoom.Door.Hole0.")
     If o Is Nothing Then
         MsgBox("Desired hole not found. Please reload the relevant .ld3 file.")
         Exit Sub
     End If
     Dim hole As DigiPara.LDX.LDXHole = DirectCast(o.GetLDXType(ObjectId.idHole), LDXHole)

     MakeVisible(ldxDocument, hole.Object.ParentObject.Comp)
     MakeVisible(ldxDocument, hole.Comp)

     With hole
         ' some holes are, like additional holes, positioned over the X/Y/Z0/1 coordinates.
         ' to take them over, we just have to enable the hmDisableInternalRules flag.
         .HoleMode = .HoleMode Xor HoleModes.hmDisableInternalRules
         If (.HoleMode And HoleModes.hmDisableInternalRules) = HoleModes.hmNone Then
             .HoleMode = .HoleMode And Not HoleModes.hmPosiByX1
             Return ' we just reset everything to defaults
         End If

         ' set position and size
         .X1 = 0
         .DX = .DX * 2

         ' to make X1 the relevant coordinate, we need to set X0 to automatic
         .HoleMode = .HoleMode Or HoleModes.hmPosiByX1
     End With
 End Sub

Example 3: Take over hole without hmPosiByDim, position by matrix

 ' from Samples/Src/LDXAPIExamples/Example_LDXHole.vb

    <APIHelpAttribute(APIHelpModes.FireCalcModel Or APIHelpModes.LoadLD3File, {APIHelpModes.InputParaLDXDoc}, "Shaft0.Entries1.E0.Panel0.Hole0.", "LDXHole~HoleMode", "Take over hole without hmPosiByDim, position by matrix")>
 Public Shared Sub PositionByMatrix(ByRef ldxDocument As DigiPara.LDX.LDXDocument)

     Dim o As DigiPara.LDX.LDXObject = ldxDocument.GetLDXObject("Shaft0.Entries1.E0.Panel0.Hole0.")
     If o Is Nothing Then
         MsgBox("Desired hole not found. Please reload the relevant .ld3 file.")
         Exit Sub
     End If
     Dim hole As DigiPara.LDX.LDXHole = DirectCast(o.GetLDXType(ObjectId.idHole), LDXHole)

     MakeVisible(ldxDocument, hole.Object.ParentObject.Comp)
     MakeVisible(ldxDocument, hole.Comp)

     With hole
         ' other holes, those without the hmPosiByDim flag, are positioned directly over their LocalMatrix
         .HoleMode = .HoleMode Xor HoleModes.hmDisableInternalRules
         If (.HoleMode And HoleModes.hmDisableInternalRules) = HoleModes.hmNone Then
             Return ' we just reset everything to defaults
         End If

         ' set position
         .Comp.LocalMatrix.R.Z = 200
         .Comp.LocalMatrix.R.X = 0

         ' increase size
         .DZ = .DZ * 2
         ' In the case where we clear hmDisableInternalRules, they will be ignored
     End With
 End Sub