KB: Layer-Specific Design Rules with Through-Hole Pads and Vias

Altium Designer Altium Designer
When defining layer-specific PCB design rules, such as clearance rules, through-hole pads and vias may not be evaluated as expected. This behavior occurs because through-hole pads and vias are Multi-Layer objects and are not returned by layer-specific queries that rely on the OnLayer membership check. To ensure that through-hole pads and vias are included in the rule scope for a specific signal layer, use the ExistsOnLayer membership check instead. This article explains the difference between the two query functions and how to correctly configure layer-specific rules that include Multi-Layer objects.

Solution Details

Unexpected Rule Behavior on Specific Layers

You defined a layer-specific rule, such as a clearance rule, and noticed that through-hole pads or vias are not being treated as expected. This can occur when the query used in the rule scope does not correctly include Multi-Layer objects.

Multi-Layer Objects Are Not On a Single Layer

Vias and through-hole pads are Multi-Layer objects. When a rule scope uses a query such as OnLayer('Top Layer'), the query only returns objects whose Layer property is explicitly set to Top Layer. Since through-hole pads and vias have their Layer property set to Multi-Layer, they are not returned by the OnLayer membership check.

However, although these objects are classified as Multi-Layer, they physically exist on the Top Layer and can therefore be returned using the ExistsOnLayer('Top Layer') membership check.

Select the Appropriate Layer Query Function

  • Use OnLayer('Top Layer') when you want to target only objects whose layer property is explicitly assigned to the specified layer.
  • Use ExistsOnLayer('Top Layer') when you want to include objects that exist on the specified layer, including through-hole pads and vias.

For layer-specific clearance rules involving through-hole pads and vias, use ExistsOnLayer in the rule scope.

Configure Rules to Include Multi-Layer Objects

  1. Open the PCB design rule that requires layer-specific behavior.
  2. Review the query expression used in the rule scope.
  3. If the query uses OnLayer('Top Layer'), verify whether through-hole pads and vias need to be included.
  4. Replace or adjust the query to use ExistsOnLayer('Top Layer') where appropriate.
  5. Validate the rule behavior and confirm that through-hole pads and vias are now included in the rule evaluation.

The following example shows a clearance rule for NetA and NetB for the Top Layer with and without the ExistsOnLayer check:

Altium PCB editor showing a 0.5 mm clearance rule between NetA and NetB on Top Layer, overriding the 0.2 mm basic clearance.

Altium PCB editor showing a 0.5 mm clearance rule for NetA to NetB on Top Layer or any layer where Top Layer exists, overriding the 0.2 mm basic clearance.

Please see the documentation for the ExistsOnLayer and OnLayer membership checks.

References

If you find an issue, select the text/image and pressCtrl + Enterto send us your feedback.