当前位置:网站首页>Revit API: schedule viewschedule

Revit API: schedule viewschedule

2022-06-24 00:04:00 Geek BIM studio

Revit Schedule definitions

Official interpretation of the schedule
Parts lists display information in tabular form , This information is extracted from the element properties in the project . A schedule can list each instance of the element type to schedule , Or compress multiple instances into one row according to the grouping standard of the parts list .
 Insert picture description here

You can create a schedule at any time during the design process . If changes to the model will affect the schedule , The schedule will automatically update to reflect these changes . You can add a schedule to a sheet .
You can export parts lists to other software programs , Such as spreadsheet program .

Schedule update
When modifying the model , All parts lists are automatically updated . for example , If you move a wall , The square feet in the room schedule are updated accordingly .
When changing the properties of building components in the model , The related parts list is automatically updated .
for example , You can select a door in the model and modify its manufacturer properties . The door schedule will reflect changes in the manufacturer's attributes .

Schedule yes Revit A view of

From the inheritance level, you can see that the schedule is View Subclasses of .
 Insert picture description here

TableView

If you want to read the contents of the parts list , It can be used ViewSchedule Parent class TableView The interface of .

namespace Autodesk.Revit.DB
{
    
    public class TableView : View
    {
    
        public int MaximumRowHeight {
     get; }
        public int MaximumColumnWidth {
     get; }
        public int MinimumRowHeight {
     get; }
        public int MinimumColumnWidth {
     get; }
        public int MaximumGridWidth {
     get; }
        public ElementId TargetId {
     get; set; }
        public static IList<ElementId> GetAvailableParameters(Document cda, ElementId categoryId);
        public IList<ElementId> GetAvailableParameterCategories(SectionType sectionType, int row);
        public string GetCalculatedValueName(SectionType sectionType, int row, int column);
        public string GetCalculatedValueText(SectionType sectionType, int row, int column);
        public string GetCellText(SectionType sectionType, int row, int column);
        public bool IsValidSectionType(SectionType sectionType);
    }
}

ViewSchedule

establish

The ViewSchedule class represents schedules and other schedule-like views, including single-category and multi-category schedules, key schedules, material takeoffs, view lists, sheet lists, keynote legends, revision schedules, and note blocks.

// ViewSchedule  Related creation interfaces 
// Creates a keynote legend.
public static ViewSchedule CreateKeynoteLegend(Document document);
// Create a key schedule.
public static ViewSchedule CreateKeySchedule(Document document, ElementId categoryId);
// Creates a material takeoff.
public static ViewSchedule CreateMaterialTakeoff(Document document, ElementId categoryId);
// Creates a note block.
public static ViewSchedule CreateNoteBlock(Document document, ElementId familyId);
// Creates a revision schedule.
public static ViewSchedule CreateRevisionSchedule(Document document);
// Creates a regular schedule that can relate to a specific area scheme.
public static ViewSchedule CreateSchedule(Document document, ElementId categoryId, ElementId areaSchemeId);
// Creates a regular schedule.
public static ViewSchedule CreateSchedule(Document document, ElementId categoryId);
// Creates a sheet list.
public static ViewSchedule CreateSheetList(Document document);
// Creates a view list.
public static ViewSchedule CreateViewList(Document document);

Definition

// ViewSchedule
public ScheduleDefinition Definition {
     get; }

Fields in the following figure 、 filter 、 Sort / Group 、 Format 、 Appearance is defined in ScheduleDefinition.
 Insert picture description here

Change the background color of parts list Columns

The following example is to set the background color of the parts list , Logically, font type, color, etc. can be set .

//  Get the style of a column 
ScheduleField field = definition.GetField(id);
TableCellStyle style = field.GetStyle();
TableCellStyleOverrideOptions options = style.GetCellStyleOverrideOptions();

// Override  Background color 
options.BackgroundColor = true;
style.SetCellStyleOverrideOptions(options);

//  Set background color 
style.BackgroundColor = highlight;
field.SetStyle(style);
原网站

版权声明
本文为[Geek BIM studio]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/174/202206232113236391.html