PREFIJA_COD

Prepend a prefix to the codes of each entity selected with a data point or multiple selection command, except codes that already have a prefix.

Parameters

Parameter number Description Values Optional
1 Prefix String without spaces, such as BAI_ or ACT_ No

Notes

Each data point selects the nearest entity in the active drawing file, like the tentative pedal. Entities in reference files cannot be selected.

The command prepends the prefix to each entity code unless it starts with ACT_, BAI_, or the specified prefix. Each code retains its database table and record. If all entity codes start with one of those prefixes, the entity remains unchanged and the error sound plays.

Multiple selection is supported. With the command active, run SELECT_WINDOW, SELECT_COD, another selection command, or Send selection to the active command in the database editor or search results pane. The command prepends the prefix to all selected entities. It ignores reference file entities, deleted entities, and entities whose codes all already have a prefix. If no selected entity changes, the error sound plays.

If Digi3D.AI cannot store an entity with the new code, for example because the drawing format does not support it, the original entity remains unchanged.

Each data point and each multiple selection has its own transaction: one UNDO reverses the change to the entity selected with a data point or to all entities in a multiple selection. The command remains active until you press reset.

To work with several prefixes, assign the command to a key or toolbar button for each prefix, for example PREFIJA_COD=ACT_ and PREFIJA_COD=BAI_.

If the prefix is missing, the command plays the error sound, displays a dialog with the reason and usage syntax, and does not start.

This command is Python script prefija_cod.py from ComandosDigi3DPython. Digi3D.AI installs it in OrdenesPython inside its installation folder. To modify it, copy the file to the macro directory and edit the copy: Digi3D.AI runs it instead of the installed file. To change the prefix list, for example, edit that copy.

The Prefix selected entity codes page explains the code.

Command characteristics

Command type Interactive command
Repeats automatically No
Menu option This command has no associated menu option
Toolbar This command has no associated toolbar button
Extension prefija_cod.py
Implementation Python
Source code prefija_cod.py
Related variables No related variables
Related commands CHNG_COD
RENOMCOD_MANTENIENDO_ATRIBUTOS