|
DigiPara Liftdesigner LDX API
|
API method: ILDXHole5.PrimaryAxisMode
Treename: Shaft0.Entries1.E0.Panel0.Hole0.
' from Samples/Src/LDXAPIExamples/Example_LDXHole.vb
<APIHelpAttribute(APIHelpModes.FireCalcModel Or APIHelpModes.LoadLD3File, {APIHelpModes.InputParaLDXDoc}, "Shaft0.Entries1.E0.Panel0.Hole0.", "LDXHole~PrimaryAxisMode", "Take over hole without hmPosiByDim, enable hmPosiByDim")>
Public Shared Sub PositionByParent(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
' we can always enable positioning by dimensions
.HoleMode = (.HoleMode Xor HoleModes.hmDisableInternalRules) Or HoleModes.hmPosiByDim
If (.HoleMode And HoleModes.hmDisableInternalRules) = HoleModes.hmNone Then
Return ' we just reset everything to defaults
End If
' thoese holes should generally be positioned relative by their parent object, but projected into the wall
' these axis modes do the trick:
.PrimaryAxisMode = MixedAxisModes.mamY Or MixedAxisModes.mamSourceWall
.SecondaryAxisMode = MixedAxisModes.mamX Or MixedAxisModes.mamSourceParent
.TertiaryAxisMode = MixedAxisModes.mamZ Or MixedAxisModes.mamSourceParent
' set position
.Z0 = 200
.X0 = 0
' increase size
.DZ = .DZ * 2
End With
End Sub