SetLightShapeStyle Method


Set the light shape style to the given shape style

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

Syntax

C#
public void SetLightShapeStyle(
	LightShapeStyle lightShapeStyle
)
Visual Basic
Public Sub SetLightShapeStyle ( _
	lightShapeStyle As LightShapeStyle _
)
Visual C++
public:
void SetLightShapeStyle(
	LightShapeStyle lightShapeStyle
)

Parameters

lightShapeStyle
Type: Autodesk.Revit.DB.Lighting LightShapeStyle
The light shape style value to set the light shape style to

Examples

Copy C#
public void ModifyLightShapeStyle(Document familyDoc)
{
    // Get the light family from the static method.
    LightFamily lightFamily = LightFamily.GetLightFamily(familyDoc);

    // Set the light shape style to circle
    lightFamily.SetLightShapeStyle( LightShapeStyle.Circle);

    // After light shape style set to circle, each type returns a CircleLightShape instance
    for (int index = 0; index < lightFamily.GetNumberOfLightTypes(); index++)
    {
        LightType lightData = lightFamily.GetLightType(index);
        CircleLightShape lightShapeInType = lightData.GetLightShape() as CircleLightShape; 
    }

}
Copy VB.NET
Public Sub ModifyLightShapeStyle(familyDoc As Document)
    ' Get the light family from the static method.
    Dim lightFamily__1 As LightFamily = LightFamily.GetLightFamily(familyDoc)

    ' Set the light shape style to circle
    lightFamily__1.SetLightShapeStyle(LightShapeStyle.Circle)

    ' After light shape style set to circle, each type returns a CircleLightShape instance
    For index As Integer = 0 To lightFamily__1.GetNumberOfLightTypes() - 1
        Dim lightData As LightType = lightFamily__1.GetLightType(index)
        Dim lightShapeInType As CircleLightShape = TryCast(lightData.GetLightShape(), CircleLightShape)
    Next

End Sub

Exceptions

Exception Condition
Autodesk.Revit.Exceptions ArgumentOutOfRangeException A value passed for an enumeration argument is not a member of that enumeration

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 →