SetLightShapeStyle Method


Set the light shape style to the given shape style

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 SetLightShapeStyle(
	LightShapeStyle lightShapeStyle
)
Visual Basic
Public Sub SetLightShapeStyle ( _
	lightShapeStyle As LightShapeStyle _
)
Visual C++
public:
void SetLightShapeStyle(
	LightShapeStyle lightShapeStyle
)

Parameters

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

Examples

CopyC#
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; 
    }

}
CopyVB.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

ExceptionCondition
Autodesk.Revit.ExceptionsArgumentOutOfRangeException A value passed for an enumeration argument is not a member of that enumeration

See Also