sch-rnd-aux knowledge pool
Action script to remove "pin numbers"
remove_pinnum by Tibor 'Igor2' Palinkas on 2022-03-14 | Tags: howto, pin, number, label, text, remove, script, automated |
Abstract: The other day Erich asked for a feature to remove "pin numbers" from the drawing before export. This did not need a new feature, just a combination of existing features. This node describes the script.
A "pin number" is really a text object within a terminal group that is marked dyntext so it can print the display/name attribute of its parent object (the terminal group). The followign script removes these objects in four steps:
- unselect everything (just in case)
- a query() script that selects all text objects that are dyntext and are within a terminal group
- use propset() to modify all the selected objects to set the floater flag (so that the "group lock" doesn't apply anymore)
- use the RemoveSelected() action to remove them
The script is:
Unselect(all) query(select, '@.type == TEXT && @.dyntext == 1 && @.parent.a.role == "terminal"') propset(p/floater, 1) RemoveSelected
This can be ran the usual ways, from the command entry from the GUI, or loaded from a file or from a shell using the batch HID. For more information, see the action class of pcb-rnd's scripting howto.
When ran from a shell, as an 5th step the SaveTo(sheet, filename) or the Export() action may be useful.