LightTypeSetInitialColor Method |
Replace the current initial color object with the given object
Namespace: Autodesk.Revit.DB.LightingAssembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntaxpublic void SetInitialColor(
InitialColor initialColor
)
Public Sub SetInitialColor (
initialColor As InitialColor
)
public:
void SetInitialColor(
InitialColor^ initialColor
)
member SetInitialColor :
initialColor : InitialColor -> unit
Parameters
- initialColor InitialColor
-
An object derived from an InitialColor object
The object pointed to is cloned internally
Exceptions
Remarks
The argument object is cloned
Examplepublic void SetInitialColorProperty(LightType lightType)
{
InitialColor initialColor = lightType.GetInitialColor();
if (initialColor is CustomInitialColor)
{
CustomInitialColor custom = initialColor as CustomInitialColor;
double colorTemperature = custom.Temperature;
custom.Temperature = 3450.0;
lightType.SetInitialColor(custom);
PresetInitialColor preset = new PresetInitialColor(ColorPreset.Halogen);
lightType.SetInitialColor(preset);
}
}
Public Sub SetInitialColorProperty(lightType As LightType)
Dim initialColor As InitialColor = lightType.GetInitialColor()
If TypeOf initialColor Is CustomInitialColor Then
Dim [custom] As CustomInitialColor = TryCast(initialColor, CustomInitialColor)
Dim colorTemperature As Double = [custom].Temperature
[custom].Temperature = 3450.0
lightType.SetInitialColor([custom])
Dim preset As New PresetInitialColor(ColorPreset.Halogen)
lightType.SetInitialColor(preset)
End If
End Sub
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
See Also