2024 Class
Changes 0
C

AssemblyViewUtils

Description:
Utilities that provide capabilities related to assembly view creation and validation.
Inheritance Hierarchy:
System.Object
  Autodesk.Revit.DB.AssemblyViewUtils
public static class AssemblyViewUtils
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;
}
Name Return Type Description
M AcquireAssemblyViews(Document, ElementId, ElementId) None Transfers the assembly views owned by a source assembly instance to a target sibling assembly instance of the same assembly type.
M Create3DOrthographic(Document, ElementId) View3D Creates a new orthographic 3D assembly view for the assembly instance.
M Create3DOrthographic(Document, ElementId, ElementId, Boolean) View3D 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.
M CreateDetailSection(Document, ElementId, AssemblyDetailViewOrientation) ViewSection Creates a new detail section assembly view for the assembly instance.
M CreateDetailSection(Document, ElementId, AssemblyDetailViewOrientation, ElementId, Boolean) ViewSection Creates a new detail section assembly view for the assembly instance.
M CreateMaterialTakeoff(Document, ElementId) ViewSchedule Creates a new material takeoff multicategory schedule assembly view for the assembly instance.
M CreateMaterialTakeoff(Document, ElementId, ElementId, Boolean) ViewSchedule Creates a new material takeoff multicategory schedule assembly view for the assembly instance.
M CreatePartList(Document, ElementId) ViewSchedule Creates a new part list multicategory schedule assembly view for the assembly instance.
M CreatePartList(Document, ElementId, ElementId, Boolean) ViewSchedule Creates a new part list multicategory schedule assembly view for the assembly instance.
M CreateSheet(Document, ElementId, ElementId) ViewSheet Creates a new sheet assembly view for the assembly instance.
M CreateSingleCategorySchedule(Document, ElementId, ElementId) ViewSchedule Creates a new single-category schedule assembly view for the assembly instance.
M CreateSingleCategorySchedule(Document, ElementId, ElementId, ElementId, Boolean) ViewSchedule Creates a new single-category schedule assembly view for the assembly instance.