Assembly: RevitAPI (in RevitAPI.dll) Version: 126.96.36.199 (188.8.131.52)
Color fill legend is a 2D annotation element, it can be created through Create(Document, ElementId, ElementId, XYZ) with specified category of color fill scheme, if there exists a valid color fill scheme activated for the category in the view. After a legend is created, its content and layout will keep consistent with the active color fill scheme of the view. You can adjust its position through Origin property, or manually maintain its layout through Height property and GetColumnWidths / methods.
- GetColorFillSchemeId(ElementId) could be used to retrieve the corresponding color fill scheme of this legend, through the and OwnerViewId properties. Note that there could only exist one active scheme for all spatial categories (rooms, areas, and zones) in one view.
- Once the height and column widths are explicitly set, they will be fixed even if the contents of the legend change.
- To retrieve correct height and column widths, it's better to manually retrieve the geometry of legend for nonvisible views. (Because color fill legend is a view specific element.)
- The value of Height property does not contain the line that displays "Calculating...".