SetLightDistributionStyle Method


Light Family Set Light Distribution Style Method

Set the light distribution style to the given shape distribution

Namespace: Autodesk.Revit.DB.Lighting
Assembly: RevitAPI (in RevitAPI.dll) Version: 27.0.4.0 (27.0.4.0)
Syntax
public void SetLightDistributionStyle(
	LightDistributionStyle lightDistributionStyle
)

Parameters

lightDistributionStyle LightDistributionStyle
The light distribution style to set the light distribution type to
Exceptions
Exception Condition
ArgumentOutOfRangeException A value passed for an enumeration argument is not a member of that enumeration
Example
C#
public void ModifyLightDistributionStyle(Document familyDoc)
{
    // Get the light family from the static method.
    LightFamily lightFamily = LightFamily.GetLightFamily(familyDoc);

    // Set the light distribution style to PhotometricWeb
    lightFamily.SetLightDistributionStyle(LightDistributionStyle.PhotometricWeb);

    // After light shape style set to PhotometricWeb, each tyoe returns a CircleLightShape instance,
    for (int index = 0; index < lightFamily.GetNumberOfLightTypes(); index++)
    {
        LightType lightData = lightFamily.GetLightType(index);
        PhotometricWebLightDistribution lightDistribution = 
            lightData.GetLightDistribution() as PhotometricWebLightDistribution;
        lightDistribution.PhotometricWebFile = @"C:\IES\1x4 2Lamp.ies"; // input a full file path here.
        lightDistribution.TiltAngle = Math.PI / 6;    // use radian value to set
        lightData.SetLightDistribution(lightDistribution);  // set back
    }
}
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 →