LightFamily
This class encapsulates light family information.
Inheritance Hierarchy
System.Object
Autodesk.Revit.DB.Lighting.LightFamily
Namespace: Autodesk.Revit.DB.Lighting
Assembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntax
public class LightFamily : IDisposable
The LightFamily type exposes the following members.
Properties
Name
Description
Public Property
IsValidObject
Specifies whether the .NET object represents a valid Revit entity.
Methods
Name
Description
Public Method
Dispose
Releases all resources used by the LightFamily
Public Method
Equals
Determines whether the specified object is equal to the current object.
(Inherited from Object)
Public Method
GetHashCode
Serves as the default hash function.
(Inherited from Object)
Public Method
GetLightDistributionStyle
Returns a LightDistributionStyle value for the light distribution
Public Method
Static Member
GetLightFamily
Creates a light family object from the given family document
Public Method
GetLightShapeStyle
Returns a LightShapeStyle value for the light shape
Public Method
GetLightSourceTransform
Returns a Transform value for the transform of light source.
Public Method
GetLightType
Return a LightType object for the light type at the given index
Public Method
GetLightTypeName
Return the name for the light type at the given index
Public Method
GetNumberOfLightTypes
Return the number of light types contained in this light family
Public Method
GetType
Gets the Type of the current instance.
(Inherited from Object)
Public Method
Code Example
SetLightDistributionStyle
Set the light distribution style to the given shape distribution
Public Method
Code Example
SetLightShapeStyle
Set the light shape style to the given shape style
Public Method
ToString
Returns a string that represents the current object.
(Inherited from Object)
Example
public void GetLightDataInFamilyDocument(Document familyDoc){ // LightFamily API should work only in light fixture family document. if (familyDoc.OwnerFamily.FamilyCategory.BuiltInCategory == BuiltInCategory.OST_LightingFixtures) return;
// Get the light family from the static method. LightFamily lightFamily = LightFamily.GetLightFamily(familyDoc);
// Get the light source shape style and distribution style LightShapeStyle shapeStyle = lightFamily.GetLightShapeStyle(); LightDistributionStyle distributionStyle = lightFamily.GetLightDistributionStyle();
// Get the light photometric for each family type for (int index = 0; index < lightFamily.GetNumberOfLightTypes(); index++) { string typeName = lightFamily.GetLightTypeName(index); // the type name LightType lightData = lightFamily.GetLightType(index); // the light data for each type // How to get and set data in LightType object, please read help document for LightType class. }}