|
DigiPara Liftdesigner LDX API
|
API method: ILDXShaft5.EXTRA_MACHINEROOM_COUNT
Treename: Shaft0.ExtraMachineryRoom0.
' from Samples/Src/LDXAPIExamples/Example_LDXShaft.vb
<APIHelpAttribute(APIHelpModes.FireCalcModel Or APIHelpModes.LoadLD3File, {APIHelpModes.InputParaLDXDoc}, "Shaft0.ExtraMachineryRoom0.", "LDXShaft~EXTRA_MACHINEROOM_COUNT", "Add more rooms")>
Public Shared Sub AdditionalMachineRooms(ByRef ldxDocument As DigiPara.LDX.LDXDocument)
If ldxDocument.GetLDXObject("Shaft0.") Is Nothing Then
MsgBox("Shaft not found! Please reload the relevant .ld3 file.")
Exit Sub
End If
' make rooms visible
For Each frame As DigiPara.LDX.LDXSheetFrame In ldxDocument.Sheets.ActiveSheet
frame.VisibleProductGroups = frame.VisibleProductGroups Or DigiPara.LDX.SheetFrameProductGroups.shfpMachineryRoom Or DigiPara.LDX.SheetFrameProductGroups.shfpElectricalEquipments
Next
With ldxDocument.Shaft
If .EXTRA_MACHINEROOM_COUNT < 2 Then
' increase count
.EXTRA_MACHINEROOM_COUNT = 2
With .ExtraMachineRoom(0)
' activate; most contained components are off, then
.Object.Active = True
' position
.POS_DY0 = .Object.Shaft.Room.DEPTH + 600
.Room.Y0 = .POS_DY0
.Room.DEPTH = 1500
End With
With .ExtraMachineRoom(1)
' activate and load from database; this comes with typical machine room components.
.Comp.ChangePartRID64(1, 0)
' note: these components are invisible in the regular plan view.
' position
.POS_DY0 = .Object.Shaft.Room.DEPTH + 600
.Room.Y0 = .POS_DY0
.POS_DX0 = .Object.Shaft.Room.Width + 600
.Room.X0 = .POS_DX0
.POS_DZ = .Object.Shaft.Room.Height
.Room.Z0 = .POS_DZ
.Room.DEPTH = 1400
End With
Else
' deactivate again
.EXTRA_MACHINEROOM_COUNT = 0
End If
End With
End Sub