|
DigiPara Liftdesigner LDX API
|
API method: ILDXSheetFrame5.VisibleBoxRules
Treename: Sheets.LdvSheet1.LdvFrame2.
' from Samples/Src/LDXAPIExamples/Example_LDXSheetFrame.vb
<APIHelpAttribute(APIHelpModes.FireCalcModel Or APIHelpModes.LoadLD3File, {APIHelpModes.InputParaLDXDoc}, "Sheets.LdvSheet1.LdvFrame2.", "LDXSheetFrame~VisibleBoxRules", "Drive visible box with rules")>
Public Shared Sub DisplayARectangularSectionWithRules(ByRef ldxDocument As DigiPara.LDX.LDXDocument)
If ldxDocument.GetObject("Sheets.LdvSheet1.LdvFrame3.") Is Nothing Then
MsgBox("Desired sheet frame not found! Please reload the relevant .ld3 file.")
Exit Sub
End If
With DirectCast(ldxDocument.GetLDXObject("Sheets.LdvSheet1.LdvFrame3.").LDXType, DigiPara.LDX.LDXSheetFrame)
' switch to side view
.Reset(DigiPara.LDX.SheetFrameViewType.shfvtVertical, DigiPara.LDX.SheetFrameViewDirections.shfvdToLeftWall, DigiPara.LDX.SheetFrameResetOptions.shfrrstInitText)
.FrameMode2 = .FrameMode2 Or DigiPara.LDX.SheetFrameModes2.shfrm2CarBasepointIsFrameX0
' Display visibile box
.FrameMode2 = .FrameMode2 Or DigiPara.LDX.SheetFrameModes2.shfrm2UseVisibleBox
Dim ruleBox As DigiPara.LDX.LDXWorldPositionRuleBox = .VisibleBoxRules
' cut bottom sligtly below car
' Shaft. is the first visible shaft of the view frame
With ruleBox.Rule(DigiPara.LDX.WorldPositionRuleModes.wprmZMin)
.ReferenceTreeName = "Shaft.Car."
.DeltaRule = "-100 - LD(""Me.DIM108"")"
End With
' cut top sligtly above car frame (the upper guide shoe, to be precise)
With ruleBox.Rule(DigiPara.LDX.WorldPositionRuleModes.wprmZMax)
.ReferenceTreeName = "Shaft.Car.Frame."
.DeltaRule = "100 + LD(""Me.L_CarFrameDimTab.CFD_GS_Z_TOP"")"
End With
' cut at the half of the rear wall
' "Me." in the rules always references the reference object, in this case the shaft.
With ruleBox.Rule(DigiPara.LDX.WorldPositionRuleModes.wprmYMax)
.ReferenceTreeName = "Shaft."
.DeltaRule = "LD(""Me.DEPTH"") + LD(""Me.W_2"")*.5"
End With
' box borders we do not care about are extended to practically infinity, so
' we do not have to worry about YMin or XMin/Max.
' after the example ran, observe how the visible box adapts to changes in shaft depth, wall width,
' car position and car frame dimensions.
End With
End Sub