pcb_get_design_rules
Retrieves every design rule from the active PCB, including names, kinds, enabled status, priorities, scopes, and clearance gaps, to verify constraints and ensure compliance.
Instructions
Get all design rules from the active PCB.
Reports every rule kind, including ones this toolset cannot create, because it iterates rule objects rather than switching on a kind.
rule_kind IS AN ALTIUM ENUM ORDINAL, NOT A NAME. It is the
raw integer, so it is only meaningful against the build that
produced it and is not worth comparing across versions. Read
descriptor instead: Altium composes it for display, so it
names the kind and carries the constraint values.
A CLEARANCE-FAMILY RULE ALSO CARRIES gap_mm, read from the
rule itself. Trust it over the descriptor for Board Outline
Clearance, whose descriptor says Gap=0mil whatever the rule
holds (measured on AD 26.10: 0.254 mm and 3 mm both described as
0). That rule's per-object table is not exposed to scripts, so a
value set only in the table is visible in Design > Rules alone.
Returns: Dictionary with "rules" array (each with name, rule_kind, enabled, priority, scope_1, scope_2, comment, descriptor, and gap_mm for clearance, component, hole-to-hole and board outline clearance rules) and "count".
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||