This class represents a set of light groups that are used for easier management of various lighting scenarios
Inheritance Hierarchy
System.ObjectAutodesk.Revit.DB.Lighting.LightGroupManager
Namespace: Autodesk.Revit.DB.Lighting
Assembly: RevitAPI (in RevitAPI.dll) Version: 26.4.0.0 (26.4.0.0)
Syntax
C#
public class LightGroupManager : IDisposable
The LightGroupManager type exposes the following members.
Properties
| Name | Description | |
|---|---|---|
| IsValidObject | Specifies whether the .NET object represents a valid Revit entity. |
Methods
| Name | Description | |
|---|---|---|
| CreateGroup | Create a new LightGroup object with the given name | |
| DeleteGroup | Remove the given LightGroup object from the set of LightGroup objects | |
| Dispose | Releases all resources used by the LightGroupManager | |
| Equals | Determines whether the specified object is equal to the current object. (Inherited from Object) | |
| GetGroups | Get the set of contained LightGroup objects The set of LightGroup objects | |
| GetHashCode | Serves as the default hash function. (Inherited from Object) | |
| GetLightDimmer | Gets the dimmer value for the given light for rendering the given view | |
| GetLightGroupManager | Creates a light group manager object from the given document | |
| GetType | Gets the Type of the current instance. (Inherited from Object) | |
| IsLightGroupOn | Returns true if the given light group is on | |
| IsLightOn | Returns true if the given light is on for rendering the given view | |
| SetLightDimmer | Sets the dimmer value for the given light for rendering the given view | |
| SetLightGroupOn | Turns the given light group on or off for rendering the given view depending on the bool argument | |
| SetLightOn | Turns the given light on or off for rendering the given view depending on the bool argument | |
| ToString | Returns a string that represents the current object. (Inherited from Object) |
Example
C#
public void AddRemoveLightGroupInManager(Document document, FamilyInstance lightOne, FamilyInstance lightTwo) { if (document.IsFamilyDocument) // it supports project document only. return; LightGroupManager groupMgr = LightGroupManager.GetLightGroupManager(document); // Add a light group with a light LightGroup lightGroup = groupMgr.CreateGroup("Group_One"); lightGroup.AddLight(lightOne.Id); // Add another light group with another light. lightGroup = groupMgr.CreateGroup("Group_Two"); lightGroup.AddLight(lightTwo.Id); // Retrieve the added light group in the manager. IList<LightGroup> existingGroups = groupMgr.GetGroups(); foreach (LightGroup group in existingGroups) { string groupName = group.Name; } // Remove one light group from the manager. groupMgr.DeleteGroup(existingGroups[0].Id); }
VB
Public Sub AddRemoveLightGroupInManager(document As Document, lightOne As FamilyInstance, lightTwo As FamilyInstance) If document.IsFamilyDocument Then ' it supports project document only. Return End If Dim groupMgr As LightGroupManager = LightGroupManager.GetLightGroupManager(document) ' Add a light group with a light Dim lightGroup As LightGroup = groupMgr.CreateGroup("Group_One") lightGroup.AddLight(lightOne.Id) ' Add another light group with another light. lightGroup = groupMgr.CreateGroup("Group_Two") lightGroup.AddLight(lightTwo.Id) ' Retrieve the added light group in the manager. Dim existingGroups As IList(Of LightGroup) = groupMgr.GetGroups() For Each group As LightGroup In existingGroups Dim groupName As String = group.Name Next ' Remove one light group from the manager. groupMgr.DeleteGroup(existingGroups(0).Id) End Sub
