DigiPara Liftdesigner LDX API
Loading...
Searching...
No Matches
Invert Cylinder

API method: ILDXCylinder5.CYL_MODE

Treename: Shaft0.Car.Frame.Cyl0.

 ' from Samples/Src/LDXAPIExamples/Example_LDXCylinder.vb

    <APIHelpAttribute(APIHelpModes.FireCalcModel Or APIHelpModes.LoadLD3File, {APIHelpModes.InputParaLDXDoc}, "Shaft0.Car.Frame.Cyl0.", "LDXCylinder~CYL_MODE", "Invert Cylinder")>
 Public Shared Sub Invert(ByRef ldxDocument As DigiPara.LDX.LDXDocument)

     If ldxDocument.GetLDXObject("Shaft0.Car.Frame.Cyl0.") Is Nothing Then
         MsgBox("Required cylinders not found!")
         Exit Sub
     End If

     Helpers.EnsureVerticalView(ldxDocument, DigiPara.LDX.SheetFrameViewDirections.shfvdToLeftWall, DigiPara.LDX.SheetFrameProductGroups.shfpPitObjects)

     With DirectCast(ldxDocument.GetLDXObject("Shaft0.Car.Frame.Cyl0.").LDXType, DigiPara.LDX.LDXCylinder)
         ' only works for CY_TYPE 0
         If 1 <> .CylinderDimTab.GetValue("CY_TYPE") Then
             .Comp.ChangePartRID64(If((ldxDocument.UNIT_MODE And DigiPara.LDX.DocUnitModes.dumProjectImperial) <> DigiPara.LDX.DocUnitModes.dumProjectImperial, 1, 5600000), 0)
         End If

         ' toggle inversion flag
         .CYL_MODE = .CYL_MODE Xor DigiPara.LDX.CylinderModes.cymInverted
     End With

 End Sub