DigiPara Liftdesigner LDX API
Loading...
Searching...
No Matches
Change Color

API method: ILDXComp5.ChangeOGLParameter

Treename: Shaft0.MachineryRoom.

 ' from Samples/Src/LDXAPIExamples/Example_LDXMachineRoom.vb

    <APIHelpAttribute(APIHelpModes.FireCalcModel Or APIHelpModes.LoadLD3File, {APIHelpModes.InputParaLDXDoc}, "Shaft0.MachineryRoom.", "LDXComp~ChangeOGLParameter", "Change Color")>
 Public Shared Sub ChangeColor(ByRef ldxDocument As DigiPara.LDX.LDXDocument)

     If ldxDocument.GetLDXObject("Shaft0.MachineryRoom.") Is Nothing OrElse
           ldxDocument.GetLDXObject("Shaft0.Gear.SH0.") Is Nothing Then
         MsgBox("Machine room components not found! Please reload the relevant .ld3 file!")
         Exit Sub
     End If

     Dim ldxComp As DigiPara.LDX.LDXComp = DirectCast(ldxDocument.GetLDXObject("Shaft0.Gear.SH0.").LDXType, DigiPara.LDX.LDXPulley).Comp
     ' Changes the color of the machine room to the color of the pulley
     With DirectCast(ldxDocument.GetLDXObject("Shaft0.MachineryRoom.").LDXType, DigiPara.LDX.LDXMachineRoom).Comp
         .ChangeOGLParameter(DigiPara.LDX.CompOGLType.ogtBlue, ldxComp.GetOGLParameter(DigiPara.LDX.CompOGLType.ogtBlue), Nothing)
         .ChangeOGLParameter(DigiPara.LDX.CompOGLType.ogtGreen, ldxComp.GetOGLParameter(DigiPara.LDX.CompOGLType.ogtGreen), Nothing)
         .ChangeOGLParameter(DigiPara.LDX.CompOGLType.ogtRed, ldxComp.GetOGLParameter(DigiPara.LDX.CompOGLType.ogtRed), Nothing)
     End With

 End Sub