pcb_get_rule_properties
Read a named PCB design rule to retrieve its metadata and human-readable constraint descriptor; clearance rules also return gap_mm for numeric clearance checks.
Instructions
Read properties of a named PCB design rule.
Returns metadata (name, rule_kind, enabled, priority) plus a
descriptor string that contains the rule's constraint values
in human-readable form, e.g.:
"Width Constraint (Min=0.102mm) (Max=5.08mm) (Preferred=0.127mm) (All)"
"Clearance Constraint (Gap=0.127mm) (All),(All)"
"Hole Size Constraint (Min=0.1mm) (Max=4mm) (All)"
"Routing Via (Templates Used To Check Via: v30h10m0mx0, ...) (All)"WHY THE DESCRIPTOR AND NOT THE NUMBERS. Constraint values live on per-kind subtype interfaces (IPCB_ClearanceConstraint, IPCB_MaxMinWidthConstraint, ...). This handler holds a base IPCB_Rule, where those members do not exist, so reading them gives nothing and the descriptor is what is offered instead. Parse it client-side if you need numeric values.
THAT IS A LIMIT OF THIS READ, NOT OF THE API, and the difference
matters because the sentence above has already been read as
"constraints are unreachable" and stopped someone who then
reported a rule as unwritable. DelphiScript DOES narrow an
interface, but only at iterator return, so a typed local
assigned straight from BoardIterator.FirstPCBObject reaches
the constraint members. pcb_set_rule_properties writes them
that way. To CHANGE a value, use that tool. obj_modify will
not do it: it dispatches through the base reference and reports
a match while changing nothing.
A clearance-family rule also returns gap_mm, read from the
rule itself; for Board Outline Clearance the descriptor says
Gap=0mil whatever the rule holds, so read gap_mm.
Args: name: Design rule name (e.g., "Clearance", "Width", "RoutingVias").
Returns: Dict with name, rule_kind, enabled, priority, descriptor, and gap_mm for a clearance-family rule.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||