How can I apply a fill color to specific elements using a Display Rule, regardless of the element type? I've created a custom Display Rule that applies a specific fill color based on a DataGroup property value, but most of the 3D elements in my file do not respond unlike 2D shapes. The 3D elements in my files typically consist of Forms, Solids, Smart Solids, etc., and while I can change the entire element color using a Display Rule I prefer to leave the edges black and fill in the shaded faces.
While 2D shapes can honor a fill override as long as the Fill value is set to Opaque, most 3D elements cannot or do not honor a fill override. These elements can be divided into two categories:
1. 3D solids may not respond to a fill override because they are often composed of linear elements, where the concept of a fill does not exist. For example, using Building Element Info we can see that the default structure for Primitive solids such as Slabs or Extrusions is shapes with connecting lines between them:
Or arcs and lines for Spheres and Cylinders for cones:
The underlying structure of a Smart Solid is entirely composed of linear elements such as lines.
While Feature Solids are Type 106 elements:When modifying a Primitive solid by adding a cut or chamfer, or using the Convert To Solid command, the Primitive solid is converted into a Smart Solid and so the underlying structure is changed to linear elements.
2. Forms, such as Walls, Slabs, Free Forms, etc., are composed of shapes, but those shapes do not have fill enabled.
When adding a cut or opening the underlying structure remains the same but fill is still not enabled.
So in order for a Form to respect a fill setting you would have to change each individual shape's fill value from None to Opaque which can be accomplished using Building Element Info.If a Form is modified by adding a feature such as a Chamfer or Fillet, or otherwise converted into a Smart Solid, then as noted above the underlying structure will be composed of linear elements which cannot have a fill applied.
However, a better solution for this particular workflow is to change your Display Rule's Action from Fill to using a shaded Display Style that has different settings than the active Display Style where your Display Rule is applied. This way only elements that meet the required criteria (based on DataGroup property values) are affected. For example:
- These are the native element colors for a Wall, Slab and Beam, in this case yellow, magenta and green, shown using the Display Style "Illustration With Shadows".
- This is a custom Display Style that sets Element color to Cyan and Edges color to dark grey with lineweight 2 (different than element color).
- This is another custom display style that uses the same Edge setting as SMOOTH2 but no color override, but it also includes a Display Rule where "Is Wall" is defined as the Condition and Display Style SMOOTH2 is defined as the Action.
The end result is that only the Wall element displays as Cyan but with the same Edge settings as all other elements.