Custom commands allow you to combine multiple commands into a single, reusable command. Instead of entering the same sequence of commands repeatedly, you can create your own commands to streamline common workflows.
This article explains how to create, edit, save, organize, and share custom commands in CET.
What Are Custom Commands?
A custom command is a user-defined command that executes a sequence of built-in CET commands or other custom commands.
Custom commands are useful when you regularly perform the same operations or want to simplify a multi-step workflow.
For example, you could create a custom command called createRoom that combines multiple wall creation commands into a single operation.
Once created and saved, custom commands can be executed from the main Command Prompt just like built-in commands.
Opening the Custom Command Prompt
To access the custom command editor:
- Open the Command Prompt.
- Click the menu button to the right of the input field.
- Select Custom Command Prompt.
The Custom Command Prompt dialog opens, displaying your existing custom commands and the editor used to create or modify them.
Understanding the Custom Command Dialog
Custom Command List
The grid displays your existing custom commands.
Select a command in the grid to view or edit its details.
The grid also uses color coding to indicate changes that have not yet been saved. Gray indicates a command that has been modified. Dark red indicates an invalid command. Light red indicates a command marked for removal.
New
Click New to create a new custom command.
A new entry is added to the grid and can be edited using the fields in the dialog. The Name field defines the command name that you will enter in the main Command Prompt. Choose a descriptive name that is easy to recognize and remember. The name of a custom command may not contain any capital letters or spaces.
The Description field defines the text displayed in the Command Prompt tooltip when the custom command is recognized. Use a brief description that explains what the command does.
Command logic is a scrollable text field where you define the operations your custom command will execute.
You can include built-in CET commands and other custom commands in your definition.
Remove
Select a custom command and click Remove to mark it for deletion.
Removed commands appear light red in the grid. The command is not permanently deleted until you click Save. You can restore a command marked for removal prior to saving by right clicking on it.
Search
Use the search field to filter the command list and quickly locate a custom command by name.
Save and Discard
The dialog includes two options for managing your changes.
Save changes
Click Save to write your changes and make the updated commands available in the main Command Prompt.
Discard changes
Click Discard changes to discard unsaved changes and restore the last saved version of your custom commands.
Close Button
Click the X button to close the dialog.
Closing the dialog with X does not discard unsaved changes. Those changes remain in memory and will still be present if you reopen the dialog during the same CET session.
However, changes that have not been saved will be lost when CET is closed.
Creating a Custom Command
Follow these steps to create a custom command:
- Open the Custom Command Prompt dialog.
- Click New.
- Enter a name for your command.
- Enter a description explaining what the command does.
- Enter the command sequence in the editor.
- Click Save changes to save your changes.
Your custom command is now available in the main Command Prompt.
How Custom Commands Work
Custom commands can execute both built-in CET commands and other custom commands.
This allows you to create increasingly complex workflows by combining existing operations.
For example, a custom command called createRoom could combine several wall creation commands to create a rectangular room.
Custom commands can also call other custom commands, allowing you to reuse previously defined operations.
Note: Custom commands can be nested. Make sure your definitions are tested and do not create unintended recursive command sequences.
Using Custom Commands
Once saved, custom commands work just like built-in commands.
To execute one:
- Open the main Command Prompt.
- Start typing the custom command name.
- Select it from the autocomplete suggestions or finish typing it.
- Enter any required arguments.
- Press Enter.
Editing and Removing Custom Commands
You can manage existing commands at any time through the Custom Command Prompt dialog.
To edit a command:
- Select the command in the grid.
- Modify its name, description, or command definition.
- Click Save changes.
To rename a command:
- Select the command.
- Change the Name field.
- Click Save changes.
To remove a command:
- Select the command.
- Click Remove.
- Click Save changes to permanently apply the removal.
Remember that changes are not written to the command file until you click Save.
Saving and Sharing Custom Commands
Custom commands are stored in a file named cmdalias.txt in your CET Documents folder.
The file is associated with the Windows user account, so CET installations using the same Windows user account share the same custom commands.
Sharing custom commands
To share your custom commands with another user:
- Locate
cmdalias.txtin your CET Documents folder. - Copy the file.
- Transfer it to the other user's corresponding CET Documents folder.
The other user can then access the custom commands through their Command Prompt.
Resetting custom commands
If you want to remove all custom commands and start over:
- Close CET.
- Locate
cmdalias.txtin your CET Documents folder. - Delete or rename the file.
- Restart CET.
CET will create a new command file as needed.
Important: Deleting this file removes all custom commands stored in it. Back up the file before deleting it if you may want to restore your commands later.
Tips for Managing Custom Commands
- Use descriptive names so commands are easy to identify.
- Write clear descriptions to help you recognize commands in the main Command Prompt.
- Reuse existing custom commands to simplify more complex workflows.
- Test commands before relying on them in important drawings.
- Save your changes before closing CET.
- Keep a backup of
cmdalias.txtbefore making significant changes or sharing commands.
Next Steps
If you encounter problems while creating or executing commands, see Troubleshooting and Tips.
Comments
0 comments
Article is closed for comments.