|
DigiPara Liftdesigner LDX API
|
API method: ILDXSheetFrame5.CarMode
Treename: Sheets.LdvSheet1.LdvFrame3.
2 code examples follow.
' from Samples/Src/LDXAPIExamples/Example_LDXSheetFrame.vb
<APIHelpAttribute(APIHelpModes.FireCalcModel Or APIHelpModes.LoadLD3File, {APIHelpModes.InputParaLDXDoc}, "Sheets.LdvSheet1.LdvFrame3.", "LDXSheetFrame~CarMode", "Customized car positions")>
Public Shared Sub CustomCarPositions(ByRef ldxDocument As DigiPara.LDX.LDXDocument)
If ldxDocument Is Nothing Then
MsgBox("Please load a document.")
Exit Sub
End If
Dim shaft = ldxDocument.Shafts(0)
Dim car = shaft.Car
' move car to bottom
car.CarMode = (car.CarMode And Not DigiPara.LDX.CarModes.carmPositionMask) Or DigiPara.LDX.CarModes.carmPositionBottom
Dim ldxFrame As DigiPara.LDX.LDXSheetFrame = Helpers.EnsureVerticalView(ldxDocument, DigiPara.LDX.SheetFrameViewDirections.shfvdToLeftWall, car.Comp.ProductGroup)
With ldxFrame
Select Case .CarMode And DigiPara.LDX.SheetFrameCarModes.shfrcmPositionMask
Case DigiPara.LDX.SheetFrameCarModes.shfrcmNone
' move car to top for this frame only
.CarMode = (car.CarMode And Not DigiPara.LDX.SheetFrameCarModes.shfrcmPositionMask) Or DigiPara.LDX.SheetFrameCarModes.shfrcmPositionTop
Case DigiPara.LDX.SheetFrameCarModes.shfrcmPositionTop
' move car to a completely custom position for this frame only
.CarMode = (car.CarMode And Not DigiPara.LDX.SheetFrameCarModes.shfrcmPositionMask) Or DigiPara.LDX.SheetFrameCarModes.shfrcmCustomPosition
' the location is relative to the shaft floor, so we probably want to add the pit depth
.CarCustomPosition = shaft.PIT + 1500
Case Else
' back to default (bottom)
.CarMode = (car.CarMode And Not DigiPara.LDX.SheetFrameCarModes.shfrcmPositionMask)
End Select
End With
End Sub
' from Samples/Src/LDXAPIExamples/Example_LDXSheetFrame.vb
<APIHelpAttribute(APIHelpModes.FireCalcModel Or APIHelpModes.LoadLD3File, {APIHelpModes.InputParaLDXDoc}, "Sheets.LdvSheet1.LdvFrame3.", "LDXSheetFrame~CarMode", "Change car and counter weight positions")>
Public Shared Sub ChangeCarAndCounterWeightPositions(ByRef ldxDocument As DigiPara.LDX.LDXDocument)
If ldxDocument.GetLDXObject("Sheets.LdvSheet1.LdvFrame3.") Is Nothing Then
MsgBox("Relevant sheet frame not found. Please reload the .ld3 file.")
Exit Sub
End If
With ldxDocument.Sheets.ActiveSheet.ActiveSheetFrame
' Car position
.CarMode = DigiPara.LDX.SheetFrameCarModes.shfrcmPositionTop
' Counterweight position
.CWMode = DigiPara.LDX.SheetFrameCWModes.shfrcwmCarPositionTop
' Car ghost position
.CarGhostMode = DigiPara.LDX.SheetFrameCarModes.shfrcmPositionBottom
' Counterweight ghost position
.CWGhostMode = DigiPara.LDX.SheetFrameCWModes.shfrcwmCarPositionBottom
' The car ghost height
.CarGhostDZ = 3000
' The counterweight ghost height
.CWGhostDZ = 3000
End With
End Sub