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: 25.0.0.0 (25.0.0.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
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