Namespace:
Autodesk.Revit.DB
AssemblyViewUtils
Class
Description:
Utilities that provide capabilities related to assembly view creation and validation.
Utilities that provide capabilities related to assembly view creation and validation.
Inheritance Hierarchy:
System.Object
Autodesk.Revit.DB.AssemblyViewUtils
System.Object
Autodesk.Revit.DB.AssemblyViewUtils
Syntax
public static class AssemblyViewUtils
Examples
private ViewSchedule CreateScheduleForAssembly(Document doc, AssemblyInstance assemblyInstance, ElementId viewTemplateId)
{
ViewSchedule schedule = null;
if (assemblyInstance.AllowsAssemblyViewCreation()) // create assembly views for this assembly instance
{
using (Transaction transaction = new Transaction(doc))
{
transaction.Start("Create Schedule");
// use naming category for the schedule
if (ViewSchedule.IsValidCategoryForSchedule(assemblyInstance.NamingCategoryId))
{
schedule = AssemblyViewUtils.CreateSingleCategorySchedule(doc, assemblyInstance.Id, assemblyInstance.NamingCategoryId, viewTemplateId, false);
}
transaction.Commit();
if (schedule != null && transaction.GetStatus() == TransactionStatus.Committed)
{
transaction.Start("Edit Schedule");
schedule.Name = "AssemblyViewSchedule";
transaction.Commit();
}
}
}
return schedule;
}