Setting View-Specific Graphics in BIM

Evgeniy Tikhonov

November 08, 2018

Using ODA BIM SDK, it’s easy to take a view and override the display of face and edge colors, fill patterns, lineweights and other parameters. Overrides are applied to elements, categories of elements, and elements passed through filter conditions.

The selected display mode of the view affects the overrides. In shaded mode, overrides are applied to faces and edges, even if a material is set, but for faces in realistic mode, textures of materials has the priority.

The OdBmDBView class has the following properties to access the data of overridden graphics:

  • OdBmAdHocOverridesPtr getAdHocOverrides() const;
  • OdBmFilterOverridesPtr getFilterOverrides() const;
  • OdBmGraphicOverridesPtr getGraphicOverrides() const;

The resulting objects contain a map of element, category, or filter condition IDs and overridden graphics data.

To simplify access to overridden graphics, OdBmDBView has three methods:

  • OdBmOverrideGraphicSettingsPtr getCategoryOverrides(const OdBm::BuiltInCategory::Enum&) const
    Returns graphic overrides for a category in the view. Input parameter is the built-in category ID.
  • OdBmOverrideGraphicSettingsPtr getElementOverrides(const OdBmObjectId&) const
    Returns graphic overrides for an element in the view. Input parameter is the element ID.
  • OdBmOverrideGraphicSettingsPtr getFilterOverrides(const OdBmObjectId&) const;
    Returns graphic overrides for a filter in the view. Input parameter is the filter element ID.

These methods return an empty pointer if there is no graphics override for the passed parameters.

The OdBmOverrideGraphicSettings class has methods to access data of graphics overrides for faces and edges:

  • OdInt32 getDetailLevel() const; // returns overridden detail level in view
  • bool getHalftone() const; // returns value of the halftone override
  • bool getProjFillPatternVisible() const; // returns visibility of fill pattern overridden for faces
  • bool getCutFillPatternVisible() const; // returns visibility of the cut surface fill pattern

The next methods return OdBmObjectPtr, which should be cast to appropriate objects:

  • OdBmObjectPtr getProjPenNumber() const; // returns OdBmGPenNumberOverriderPtr - the projection surface lineweight
  • OdBmObjectPtr getCutPenNumber() const; // returns OdBmGPenNumberOverriderPtr - the cut surface lineweight
  • OdBmObjectPtr getProjLinePattern() const; // returns OdBmGLinePatternOverriderPtr - the projection surface line pattern
  • OdBmObjectPtr getCutLinePattern() const; // returns OdBmGLinePatternOverriderPtr - the cut surface line pattern
  • OdBmObjectPtr getProjPenColor() const; // returns OdBmGStyleColorOverriderPtr - the projection surface line color
  • OdBmObjectPtr getCutPenColor() const; // returns OdBmGStyleColorOverriderPtr - the cut surface line color
  • OdBmObjectPtr getProjFillPattern() const; // returns OdBmGFillPatternOverriderPtr - the surface fill pattern
  • OdBmObjectPtr getCutFillPattern() const; // returns OdBmGFillPatternOverriderPtr - the cut surface fill pattern
  • OdBmObjectPtr getProjFillColor() const; // returns OdBmGFillColorOverriderPtr - the projection surface fill color
  • OdBmObjectPtr getCutFillColor() const; // returns OdBmGFillColorOverriderPtr - the cut surface fill color
  • OdBmGSurfacesTransparencyOverriderPtr getSurfacesTransparency() const; // returns the projection and cut surface transparency

Combining graphics overrides in the view

If an element’s graphic overrides are set by element, category and filter condition, the resulting overrides should be combined using this priority: element, category, filter.