AssemblyViewUtils
Utilities that provide capabilities related to assembly view creation and validation.
Inheritance Hierarchy
System.Object
Autodesk.Revit.DB.AssemblyViewUtils
Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntax
public static class AssemblyViewUtilsThe AssemblyViewUtils type exposes the following members.
Methods
Name
Description
Public Method
Static Member
AcquireAssemblyViews
Transfers the assembly views owned by a source assembly instance to a target sibling assembly instance of the same assembly type.
Public Method
Static Member
Create3DOrthographic(Document, ElementId)
Creates a new orthographic 3D assembly view for the assembly instance.
Public Method
Static Member
Create3DOrthographic(Document, ElementId, ElementId, Boolean)
Creates a new orthographic 3D assembly view for the assembly instance. The view will have the same orientation as the Default 3D view. The document must be regenerated before using the 3D view.
Public Method
Static Member
CreateDetailSection(Document, ElementId, AssemblyDetailViewOrientation)
Creates a new detail section assembly view for the assembly instance.
Public Method
Static Member
CreateDetailSection(Document, ElementId, AssemblyDetailViewOrientation, ElementId, Boolean)
Creates a new detail section assembly view for the assembly instance.
Public Method
Static Member
CreateMaterialTakeoff(Document, ElementId)
Creates a new material takeoff multicategory schedule assembly view for the assembly instance.
Public Method
Static Member
CreateMaterialTakeoff(Document, ElementId, ElementId, Boolean)
Creates a new material takeoff multicategory schedule assembly view for the assembly instance.
Public Method
Static Member
CreatePartList(Document, ElementId)
Creates a new part list multicategory schedule assembly view for the assembly instance.
Public Method
Static Member
CreatePartList(Document, ElementId, ElementId, Boolean)
Creates a new part list multicategory schedule assembly view for the assembly instance.
Public Method
Static Member
CreateSheet
Creates a new sheet assembly view for the assembly instance.
Public Method
Static Member
CreateSingleCategorySchedule(Document, ElementId, ElementId)
Creates a new single-category schedule assembly view for the assembly instance.
Public Method
Static Member
CreateSingleCategorySchedule(Document, ElementId, ElementId, ElementId, Boolean)
Creates a new single-category schedule assembly view for the assembly instance.
Example
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;}