2022 Class
Changes 0
C

LightFamily

Description:
This class encapsulates light family information.
Inheritance Hierarchy:
System.Object
  Autodesk.Revit.DB.Lighting.LightFamily
public class LightFamily : IDisposable
public void GetLightDataInFamilyDocument(Document familyDoc)
{
    // LightFamily API should work only in light fixture family document.
    if (familyDoc.OwnerFamily.FamilyCategory.Id.IntegerValue == (int)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.
    }
}
Name Return Type Description
M Dispose() None Releases all resources used by the
M GetLightDistributionStyle() LightDistributionStyle Returns a LightDistributionStyle value for the light distribution
M GetLightFamily(Document) LightFamily Creates a light family object from the given family document
M GetLightShapeStyle() LightShapeStyle Returns a LightShapeStyle value for the light shape
M GetLightSourceTransform() Transform Returns a Transform value for the transform of light source.
M GetLightType(Int32) LightType Return a LightType object for the light type at the given index
M GetLightTypeName(Int32) string Return the name for the light type at the given index
M GetNumberOfLightTypes() int Return the number of light types contained in this light family
M SetLightDistributionStyle(LightDistributionStyle) None Set the light distribution style to the given shape distribution
M SetLightShapeStyle(LightShapeStyle) None Set the light shape style to the given shape style
Name Return Type Description
P IsValidObject bool Specifies whether the .NET object represents a valid Revit entity.