CheckoutElementsRequestTooLargeException
Description:
Exception is thrown when too many elements are requested for checkout
Exception is thrown when too many elements are requested for checkout
Inheritance Hierarchy:
System.Object
System.Exception
Autodesk.Revit.Exceptions.ApplicationException
Autodesk.Revit.Exceptions.CentralModelException
Autodesk.Revit.Exceptions.CheckoutElementsRequestTooLargeException
System.Object
System.Exception
Autodesk.Revit.Exceptions.ApplicationException
Autodesk.Revit.Exceptions.CentralModelException
Autodesk.Revit.Exceptions.CheckoutElementsRequestTooLargeException
[SerializableAttribute]
public class CheckoutElementsRequestTooLargeException : CentralModelException
void HandleCheckoutElementsRequestTooLargeException(Document doc)
{
FilteredElementCollector collector = new FilteredElementCollector(doc);
ICollection<ElementId> rooms = collector.WherePasses(new RoomFilter()).ToElementIds();
try
{
ICollection<ElementId> checkoutelements = WorksharingUtils.CheckoutElements(doc, rooms);
}
catch (Autodesk.Revit.Exceptions.CheckoutElementsRequestTooLargeException)
{
IEnumerable<WorksetId> worksets = rooms.Select(elemId => doc.GetWorksetId(elemId)).Distinct();
TaskDialog dlg = new TaskDialog("Elements can't be checked out")
{
MainInstruction = $"You are trying to check out a large number of elements. Instead check out the following {worksets.Count()} worksets:",
MainContent = string.Join(", ", worksets),
};
dlg.Show();
TransactWithCentralOptions twcOptions = new TransactWithCentralOptions();
ISet<WorksetId> worksetsCheckedout = WorksharingUtils.CheckoutWorksets(doc, worksets.ToHashSet(), twcOptions);
TaskDialog.Show(
title: "Worksets are checked out",
mainInstruction: $"{worksetsCheckedout.Count} worksets are checked out.");
}
}
| Name | Return Type | Description | Inherited From |
|---|---|---|---|
| GetObjectData(SerializationInfo, StreamingContext) | None | Retrieves data needed to serialize the target object. | |
| GetObjectData(SerializationInfo, StreamingContext) | None | Retrieves data needed to serialize the target object. | ApplicationException |
| GetObjectData(SerializationInfo, StreamingContext) | None | Retrieves data needed to serialize the target object. | CentralModelException |
| Name | Return Type | Description | Inherited From |
|---|---|---|---|
| FunctionId | FunctionId | The information of the function throwing the exception. | ApplicationException |