DigiPara Liftdesigner LDX API
Loading...
Searching...
No Matches
Reinforce all walls

Treename: Shaft0.MachineryRoom.REINFORCEMENTS.WallSegments.

 ' from Samples/Src/LDXAPIExamples/Example_LDXMachineRoom.vb

 Public Shared Sub MakeAutomatic(o As DigiPara.LDX.LDXObject, d As String)
     Dim name = "Me.DistMode." + d
     Dim oldMode As DigiPara.LDX.SheetFrameOverwriteDimModes = o.GetValue(name)
     o.SetValue(name, oldMode Or DigiPara.LDX.SheetFrameOverwriteDimModes.sfodmCalcAuto)
 End Sub

 Public Shared Sub ReinforceWalls(ldxComp As DigiPara.LDX.LDXComp)
     ' adds wall segments for each of the side walls so they get immune against the main shaft and machine room holes
     For wall As Int16 = 1 To 4
         Dim segment As DigiPara.LDX.LDXWallSegment = ldxComp.WallSegments.Add()
         ' these essentially set the defaults the UI would apply to a new wall segments
         With segment
             .Object.Active = True
             .Comp.Wall = wall
             .ALTERNATIVE_MATERIAL = DigiPara.LDX.ShaftMaterial.smClassic

             ' make segment add its own material, activate hatching
             .WallSegmentMode = .WallSegmentMode Or DigiPara.LDX.WallSegmentModes.wsmFill Or DigiPara.LDX.WallSegmentModes.wsmHatchAll
             With .Hole
                 ' activate custom positioning logic, mark as belonging to the machine room
                 .HoleMode = .HoleMode Or DigiPara.LDX.HoleModes.hmAdditionalHole Or DigiPara.LDX.HoleModes.hmRelatedToMachineRoom

                 ' placement logic relative to wall
                 Dim commonModes As DigiPara.LDX.MixedAxisModes = DigiPara.LDX.MixedAxisModes.mamSourceWall Or DigiPara.LDX.MixedAxisModes.mamOriginOutside
                 .PrimaryAxisMode = commonModes Or DigiPara.LDX.MixedAxisModes.mamY
                 .SecondaryAxisMode = commonModes Or DigiPara.LDX.MixedAxisModes.mamZ
                 .TertiaryAxisMode = commonModes Or DigiPara.LDX.MixedAxisModes.mamX

                 ' make segment fill the entire wall
                 .X0 = 0
                 .Y0 = 0
                 .Z0 = 0
                 .X1 = 0
                 .Y1 = 0
                 .Z1 = 0
             End With

             ' make D* values calculate automatically from *0 and *1
             MakeAutomatic(.Object, "DX")
             MakeAutomatic(.Object, "DY")
             MakeAutomatic(.Object, "DZ")
         End With
     Next
 End Sub

 <APIHelpAttribute(APIHelpModes.FireCalcModel Or APIHelpModes.LoadLD3File, {APIHelpModes.InputParaLDXDoc}, "Shaft0.MachineryRoom.REINFORCEMENTS.WallSegments.", "LDXMachineRoom~Example_ReinforceWalls", "Reinforce all walls")>
 Public Shared Sub ReinforceMachineRoomWalls(ByRef ldxDocument As DigiPara.LDX.LDXDocument)

     Dim machineRoom As DigiPara.LDX.LDXMachineRoom = ldxDocument.Shaft.MachineRoom

     ' attach wall segments to user comp, not machine room directly, so they get applied in the right shaft creation step
     machineRoom.Comp.UserChildren.Clear()
     Dim userComp As DigiPara.LDX.LDXUserComp = machineRoom.Comp.UserChildren.Add("REINFORCEMENTS.").GetLDXType(DigiPara.LDX.ObjectId.idUserComp)
     ' make child segments be switched with the machine room visible group only
     userComp.ProductGroup = DigiPara.LDX.SheetFrameProductGroups.shfpMachineryRoom
     ReinforceWalls(userComp.Comp)

     ' this would create the blocks during the wrong step
     ' ReinforceWalls(machineRoom.Comp)

     machineRoom.POS_DZ = -1000
 End Sub