How to Use Command Aliases in BricsCAD
Quick answer: Command aliases are alternative, shorter names for BricsCAD commands, typing L instead of LINE, for example, saved in a .pgp file, default.pgp in the Support folder of the Roamable Root folder by default, the same location covered on this hub’s user files page. Some commands have multiple aliases; RECTANG, for instance, has REC, RECT, and even RECTANGLE, which is actually longer than the command name itself.
Using Aliases Transparently
If a command can run transparently (while another command is active), its alias can too, precede the alias with an apostrophe (') to run it that way, the same convention used for transparent commands generally elsewhere in this hub.
Alias Limitations
Two worth knowing: aliases are local only and can’t be used as global commands preceded by an underscore (_), unlike regular commands. And aliases can’t be used inside scripts (.scr files) at all.
Editing the Alias File Directly
The default.pgp file has two sections: Shell commands first, then command aliases. Edit it in any ASCII text editor, like Notepad.
The syntax for an alias is alias,*command, the alias string, followed by a comma, then the command name preceded by an asterisk. Comment lines start with a semicolon (;), useful for noting when the file was last edited and by whom.
Commands that support a Command-line-only variant (preceded by a hyphen, like -VIEW) can have aliases defined for that variant too, for example: vi,*-view.
After editing the file externally, run REINIT to reload it.
Using the Customize Dialog Instead
Open the Command Aliases tab of the Customize dialog.
Creating a new alias: click Add, right-click an existing alias and choose Add Alias, or right-click a command and choose Add Alias to create one for that specific command. In the Add Alias dialog, type the alias, select the command from the dropdown (typing filters the list), and click OK.
Editing an existing alias: select it, click Edit or right-click and choose Edit Alias, type the new alias (you’ll be prompted to overwrite if it already exists), and click OK.
Deleting an alias: select it, click Delete or right-click and choose Delete, then confirm.
Using the Customize dialog this way, there’s no need to run REINIT afterward, unlike editing the .pgp file directly in a text editor.
Frequently Asked Questions
Can I use a command alias inside a script file? No, aliases can’t be used in .scr script files at all, only full command names work there.
Do I need to reload anything after creating an alias through the Customize dialog? No, REINIT is only needed if you’ve edited the .pgp file directly in a text editor.
Can an alias be used with the underscore prefix like a global command? No, aliases are local only and can’t be used as global commands preceded by an underscore.
How do I create an alias for the Command-line-only version of a command like -VIEW? Precede the command name with a hyphen in the alias definition, for example vi,*-view.