User-defined default unity for the custom DRC Rules (currently on v5.99)

Hey guys, what do you think about having a command to set the default unit for the rule file?
I am not an expert, but maybe something like this would be good since it has to be put before everything.

(version 1
	(unit mm))

Then, if the unit is not added to any rule Kicad can fallback unity defined by the user.
It is good to have such a thing because we can skip adding units everywhere.

Then it would be impossible to copypaste rules between files.

How? It is just a matter of using the unity next to the number.

For instance, this will set the default unit in case of any unity is set.
However, the user can still set one rule to 1mm and the other with 1mil. This will have priority since they will override the default option.

Because if in one file the default is set, say, to mil and the values are bare values without the unit. Then if I copy and paste it to a file which has mm as the default value, I have to change every damn value, or at least every rule, manually in the pasted section to have a different unit.

@JeffYoung can comment more.

I seeā€¦ I was just asking for a friend, haha.

What if the case that (unit mm) could be a function to be applied in a bunch of rules at once then if you copy something without the unity you can reassign one by doing something like this

(unit mm
    (rules in mm that do not have unity...))

(unit mil
    (rules in mil that do not have unity...))

but I agree that in the case you are saying it would be a pain. Thanks for the answer.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.