Namespace:
Autodesk.Revit.DB.Lighting
LightGroupManager
Class
Description:
This class represents a set of light groups that are used for easier management of various lighting scenarios
This class represents a set of light groups that are used for easier management of various lighting scenarios
Inheritance Hierarchy:
System.Object
Autodesk.Revit.DB.Lighting.LightGroupManager
System.Object
Autodesk.Revit.DB.Lighting.LightGroupManager
Syntax
public class LightGroupManager : IDisposable
Examples
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);
}