FeatureSymbology.Overrides Class

Allows a Viewport to customize the appearance of individual Features within it.

The Viewport computes its base Overrides based on the following:

  • The set of categories enabled for display in its CategorySelectorState. Every SubCategory belonging to an enabled Category is added to the set of visible subcategories - all other subcategories are assumed to be invisible.
  • For the set of visible subcategories, any SubCategoryOverrides defined by the view's DisplayStyleState are applied. This may render some subcategories invisible, and change the symbology of others.
  • The visibility of each GeometryClass is set based on the view's ViewFlags.
  • The line weight is overridden to 1 pixel for all Features if line weight has been disabled by the view's ViewFlags.
  • The sets of elements which are always drawn and never drawn are initialized from the Viewport's sets. An application can further customize the symbology of any Features by registering a FeatureSymbology.Overrides.FeatureOverrideProvider with a Viewport. That provider's addFeatureOverrides function will be invoked whenever the Overrides need to be regenerated.

To override the symbology of most Features within a view, specify a defaultOverrides to be applied to any Feature not explicitly overridden. If default overrides are defined and some Features should draw normally without being affected by the default overrides, override that Feature with an Appearance which defines no overrides.

It is possible to override multiple aspects of a Feature. For example, you might specify that all elements belonging to subcategory "A" should be drawn in red, and that the element with Id "0x123" should be drawn with 0.25 transparency. In this case, when drawing a Feature with subcategory "A" and element Id "0x123", the two overrides will be merged, causing the Feature's geometry to draw 25% transparent red. On the other hand, if subcategory "A" is specified to draw in red and element "0x123" to draw in green, the color specified by the element override will take precedence over that specified for the subcategory, resulting in a green Feature.

see Viewport.alwaysDrawn

see Viewport.neverDrawn

Extends

Methods

Name Description
constructor(view?: ViewState | Viewport): FeatureSymbology.Overrides Construct a new Overrides.  

Inherited methods

Name Inherited from Description
getElementOverridesById(id: Id64String): FeatureAppearance | undefined FeatureOverrides Returns the overrides applied to geometry belonging to the specified element, if any such are defined.
getFeatureAppearance(feature: Feature, modelId: Id64String, type?: BatchType): FeatureAppearance | undefined FeatureOverrides Returns the feature's appearance overrides, or undefined if the feature is not visible.
getModelOverridesById(id: Id64String): FeatureAppearance | undefined FeatureOverrides Returns the overrides applied to geometry belonging to the specified model, if any such are defined.
getSubCategoryOverridesById(id: Id64String): FeatureAppearance | undefined FeatureOverrides Returns the overrides applied to geometry belonging to the specified subcategory, if any such are defined.
isFeatureVisible(feature: Feature): boolean FeatureOverrides Returns true if the specified Feature will be drawn.
isSubCategoryIdVisible(id: Id64String): boolean FeatureOverrides Returns true if geometry belonging to the specified subcategory will be drawn.
isSubCategoryVisible(idLo: number, idHi: number): boolean FeatureOverrides Returns true if the SubCategory specified by Id is in the set of visible subcategories.
overrideAnimationNode(id: number, app: FeatureAppearance): void FeatureOverrides Specify overrides for all geometry originating from the specified animation node.
overrideElement(id: Id64String, app: FeatureAppearance, replaceExisting?: false | true): void FeatureOverrides Specify overrides for all geometry originating from the specified element.
overrideModel(id: Id64String, app: FeatureAppearance, replaceExisting?: false | true): void FeatureOverrides Specify overrides for all elements within the specified model.
overrideSubCategory(id: Id64String, app: FeatureAppearance, replaceExisting?: false | true): void FeatureOverrides Specify overrides for all geometry belonging to the specified SubCategory.
setAlwaysDrawn(id: Id64String): void FeatureOverrides Specify the Id of an element that should always be drawn.
setAlwaysDrawnSet(ids: Id64Set, exclusive: boolean, ignoreSubCategory?: false | true): void FeatureOverrides Specify the Ids of elements that should always be drawn.
setAnimationNodeNeverDrawn(id: number): void FeatureOverrides Specify the Id of a animation node that should never be drawn.
setDefaultOverrides(appearance: FeatureAppearance, replaceExisting?: false | true): void FeatureOverrides Defines a default appearance to be applied to any FeatureOverrides.Feature not explicitly overridden.
setNeverDrawn(id: Id64String): void FeatureOverrides Specify the Id of an element that should never be drawn.
setNeverDrawnSet(ids: Id64Set): void FeatureOverrides Specify the Ids of elements that should never be drawn.
setVisibleSubCategory(id: Id64String): void FeatureOverrides Add a SubCategory to the set of visible subcategories.

Inherited properties

Name Type Inherited from Description
_alwaysDrawn Protected Uint32Set FeatureOverrides Ids of elements that should always be drawn.
_constructions Protected boolean FeatureOverrides Whether construction geometry should be drawn.
_defaultOverrides Protected FeatureAppearance FeatureOverrides Overrides applied to any feature not explicitly overridden.
_dimensions Protected boolean FeatureOverrides Whether dimensions should be drawn.
_elementOverrides Protected Uint32Map<FeatureAppearance> FeatureOverrides Overrides applied to specific elements.
_lineWeights Protected boolean FeatureOverrides Whether line weights should be applied.
_modelOverrides Protected Uint32Map<FeatureAppearance> FeatureOverrides Overrides applied to all elements belonging to each model.
_neverDrawn Protected Uint32Set FeatureOverrides Ids of elements that should never be drawn.
_patterns Protected boolean FeatureOverrides Whether area patterns should be drawn.
_subCategoryOverrides Protected Uint32Map<FeatureAppearance> FeatureOverrides Overrides applied to geometry belonging to each subcategory.
_subCategoryPriorities Protected Uint32Map<number> FeatureOverrides Display priorities assigned to subcategories, possibly overridden by display style.
_visibleSubCategories Protected Uint32Set FeatureOverrides The set of displayed subcategories.
alwaysDrawnIgnoresSubCategory boolean FeatureOverrides If true, the always-drawn elements are drawn even if their subcategories are not visible.
defaultOverrides Accessor ReadOnly FeatureAppearance FeatureOverrides Overrides applied to features for which no other overrides are defined
isAlwaysDrawnExclusive boolean FeatureOverrides If true, no elements except those defined in the "always drawn" set will be drawn.
lineWeights Accessor ReadOnly boolean FeatureOverrides Whether or not line weights are applied. If false, all lines are drawn with a weight of 1.

Defined in

Last Updated: 16 August, 2020