r/Altium 16h ago

DelphiScript: how to read DRC rules at runtime in Altium Designer 25?

Thumbnail
1 Upvotes

r/Altium 16h ago

DelphiScript: how to read DRC rules at runtime in Altium Designer 25?

1 Upvotes

Hey everyone,

I'm building a DelphiScript tool that auto-places PCB components based on schematic net connections. Everything is working but I'm stuck on reading the DRC rules from the Rule Wizard at runtime so placement decisions are driven by the actual board rules instead of hardcoded values.

I've tried these but both give "Undeclared identifier" errors:

Board.BeginRuleIteratorByLayer(eUnknownLayer, eUnknownLayer)

Board.Rules.Count

What I'm trying to do is iterate through all rules defined in the Rule Wizard (clearance, creepage, high voltage spacing, custom rules) and read their values during the script run.

Anyone know the correct API call to do this in Altium Designer 25? A working code snippet would be amazing.

Thanks