SetInitialIntensity Method


Replace the current initial intensity object with the given object

Namespace: Autodesk.Revit.DB.Lighting
Assembly: RevitAPI (in RevitAPI.dll) Version: 24.0.0.0 (24.0.0.0)
Since:  2013

Syntax

C#
public void SetInitialIntensity(
	InitialIntensity initialIntensity
)
Visual Basic
Public Sub SetInitialIntensity ( _
	initialIntensity As InitialIntensity _
)
Visual C++
public:
void SetInitialIntensity(
	InitialIntensity^ initialIntensity
)

Parameters

initialIntensity
Type: Autodesk.Revit.DB.LightingInitialIntensity
An object derived from an InitialIntensity object

Remarks

The argument object is cloned

Examples

CopyC#
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);
    }
}
CopyVB.NET
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

Exceptions

ExceptionCondition
Autodesk.Revit.ExceptionsArgumentNullException A non-optional argument was null

See Also

ArchiLabs Desktop

Put AI to work inside Revit.

Give Desktop your instructions and project files to build Revit families, update model elements, and create views and schedules. Works directly in Revit and AutoCAD.

Explore Desktop →