Share

LightType.SetInitialIntensity Method

Replace the current initial intensity object with the given object


Namespace: Autodesk.Revit.DB.Lighting
Assembly: RevitAPI (in RevitAPI.dll) Version: 26.1.0.0 (26.1.0.34)

Syntax

C#

public void SetInitialIntensity(
	InitialIntensity initialIntensity
)

Parameters

initialIntensity  InitialIntensity
An object derived from an InitialIntensity object

Exceptions

ExceptionCondition
ArgumentNullException A non-optional argument was null

Remarks

The argument object is cloned

Example

C#

public void SetInitialIntensityProperty(LightType lightType)
{
    InitialIntensity initialIntensity = lightType.GetInitialIntensity();
    if (initialIntensity is InitialFluxIntensity)
    {
        InitialFluxIntensity fluxIntensity = initialIntensity as InitialFluxIntensity;
        double fluxValue = fluxIntensity.Flux;

        // Set new value for Flux proeprty and set modified InitialIntensity to LightType.
        fluxIntensity.Flux = 34.50;
        lightType.SetInitialIntensity(fluxIntensity);

        // Create a InitialWattageIntensity and set it to LightType.
        InitialWattageIntensity wattageIntensity = new InitialWattageIntensity(25.57, 130.89);
        lightType.SetInitialIntensity(wattageIntensity);
    }
}

VB

Public Sub SetInitialIntensityProperty(lightType As LightType)
   Dim initialIntensity As InitialIntensity = lightType.GetInitialIntensity()
   If TypeOf initialIntensity Is InitialFluxIntensity Then
      Dim fluxIntensity As InitialFluxIntensity = TryCast(initialIntensity, InitialFluxIntensity)
      Dim fluxValue As Double = fluxIntensity.Flux

      ' Set new value for Flux proeprty and set modified InitialIntensity to LightType.
      fluxIntensity.Flux = 34.5
      lightType.SetInitialIntensity(fluxIntensity)

      ' Create a InitialWattageIntensity and set it to LightType.
      Dim wattageIntensity As New InitialWattageIntensity(25.57, 130.89)
      lightType.SetInitialIntensity(wattageIntensity)
   End If
End Sub

See Also

Reference

Was this information helpful?