LightGroup Class


This class represents a set of lights grouped together for easier management of various lighting scenarios

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

Syntax

C#
public class LightGroup : IDisposable
Visual Basic
Public Class LightGroup _
	Implements IDisposable
Visual C++
public ref class LightGroup : IDisposable

Examples

Copy C#
public void AddRemoveLightInGroup(LightGroup groupOne, LightGroup groupTwo, FamilyInstance lightOne, FamilyInstance lightTwo)
{
    // Add two lights into groupOne.
    groupOne.AddLight(lightOne.Id);
    groupOne.AddLight(lightTwo.Id);

    // Move a light from groupOne to groupTwo
    groupTwo.AddLight(lightOne.Id);

    // Retrieve the added lights in the group
    ICollection<ElementId> existingLightIds = groupOne.GetLights();

    // remove the light
    groupOne.RemoveLight(lightTwo.Id);
}
Copy VB.NET
Public Sub AddRemoveLightInGroup(groupOne As LightGroup, groupTwo As LightGroup, lightOne As FamilyInstance, lightTwo As FamilyInstance)
    ' Add two lights into groupOne.
    groupOne.AddLight(lightOne.Id)
    groupOne.AddLight(lightTwo.Id)

    ' Move a light from groupOne to groupTwo
    groupTwo.AddLight(lightOne.Id)

    ' Retrieve the added lights in the group
    Dim existingLightIds As ICollection(Of ElementId) = groupOne.GetLights()

    ' remove the light
    groupOne.RemoveLight(lightTwo.Id)
End Sub

Inheritance Hierarchy

System Object
Autodesk.Revit.DB.Lighting LightGroup

See Also

ArchiLabs

Stop fighting Revit automation.

Build repeatable BIM design and documentation workflows with scripts, data, and AI in one place, without wrestling brittle one-off automations.

Try ArchiLabs →