Share

LightFamily.SetLightShapeStyle Method

Set the light shape style to the given shape style


Namespace: Autodesk.Revit.DB.Lighting
Assembly: RevitAPI (in RevitAPI.dll) Version: 26.1.0.0 (26.1.0.34)

Syntax

C#

public void SetLightShapeStyle(
	LightShapeStyle lightShapeStyle
)

Parameters

lightShapeStyle  LightShapeStyle
The light shape style value to set the light shape style to

Exceptions

ExceptionCondition
ArgumentOutOfRangeException A value passed for an enumeration argument is not a member of that enumeration

Example

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

}

VB

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

See Also

Reference

Was this information helpful?