DigiPara Liftdesigner LDX API
Loading...
Searching...
No Matches
Display a rectangular section

API method: ILDXSheetFrame5.VisibleBox

Treename: Sheets.LdvSheet1.LdvFrame2.

 ' from Samples/Src/LDXAPIExamples/Example_LDXSheetFrame.vb

    <APIHelpAttribute(APIHelpModes.FireCalcModel Or APIHelpModes.LoadLD3File, {APIHelpModes.InputParaLDXDoc}, "Sheets.LdvSheet1.LdvFrame2.", "LDXSheetFrame~VisibleBox", "Display a rectangular section")>
 Public Shared Sub DisplayARectangularSection(ByRef ldxDocument As DigiPara.LDX.LDXDocument)

     If ldxDocument.GetObject("Sheets.LdvSheet1.LdvFrame2.") 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.LdvFrame2.").LDXType, DigiPara.LDX.LDXSheetFrame)
         ' switch to plan view (should be the default already)
         .Reset(DigiPara.LDX.SheetFrameViewType.shfvtPlan, DigiPara.LDX.SheetFrameViewDirections.shfvdToFromTop, DigiPara.LDX.SheetFrameResetOptions.shfrrstInitText)
         .FrameMode2 = .FrameMode2 Or DigiPara.LDX.SheetFrameModes2.shfrm2CarBasepointIsFrameX0

         ' Display visibile box 
         .FrameMode2 = .FrameMode2 Or DigiPara.LDX.SheetFrameModes2.shfrm2UseVisibleBox

         With .VisibleBox
             ' Bottom left point
             .PtMin.X = -1200
             .PtMin.Y = 600

             ' Top right point
             .PtMax.X = 3000
             .PtMax.Y = 2000

             ' ignore Z
             .PtMax.Z = 1.0E+29
             .PtMin.Z = -1.0E+29

             ' small potential problem: the box propery .Limit will yield True if you set the limits
             ' to something larger than 1E+30, which would lead to some places in RefModel codes to assume
             ' that VisibleBox is invalid. So it is safest to keep 'practically infinite' values
             ' still below 1E+30 in absolute value.
         End With

         ' In LD2020, you have to follow this procedure instead:
         '.VisibleBox.Limit = True
         '.VisibleBox.AddPoint(-1200, 600, -100000)
         '.VisibleBox.AddPoint(3000, 2000, 100000)
     End With

 End Sub