> For the complete documentation index, see [llms.txt](https://help.auxalia.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.auxalia.com/plant-tools/plantexpresstools/how-to-use/symbolspalette/usage/add-autocadautolisp-command.md).

# Add AutoCAD/AutoLISP command

This chapter describes how you can add AutoCAD Commands or add AutoLISP code to the SymbolsPalette.

<details>

<summary>Add AutoCAD Command</summary>

Enable **Edit Mode** first (see [Edit Mode)](/plant-tools/plantexpresstools/how-to-use/symbolspalette/usage/edit-mode.md). To add an AutoCAD/AutoLISP Command you first must create a **Custom Class**. In this example you can see the folder **Command** with the two sub-folders **AutoCAD** and **AutoLISP**.

![](/files/UdxK3r32oZjr5Dl97BZ4)

To create an **AutoCAD/AutoLISP Command** you make a right-click on a **Custom Class**. If AutoCAD Plant 3D was started you will see **Add New Custom Object...** in the context menu of the **Custom Class**. After that you select **Add AutoCAD command or AutoLISP...**.

![](/files/mSeOMAr2dOhKB6rNuZd6)

If you have added a **AutoCAD command or AutoLISP** before and use the context menu again, you will see, that **Add AutoCAD command or AutoLISP...** is shown already in the context menu where you can click on without the need of going to the sub context menu.

![](/files/DCxoqt4QatZg8f5YPER7)

If you have added a **Hyperlink** before and use the context menu again, you will see, that **Add Hyperlink** is shown in the context menu. Here you have to go then to **Add AutoCAD command or AutoLISP...**.

![](/files/1s1QiAxiVKS05x32IxAx)

All these variations should help you to work a bit faster when adding one **AutoCAD/AutoLISP Command** after the other. You can also make a right-click on right side of the **SymbolsPalette** to add an **AutoCAD/AutoLISP Command**. The context menu on this side is also adapting depending on your previous selection.

![](/files/Cxsjt7eFi6q0WDs4bOcW)

In any case, the **Add New Custom Object** dialog opens.

![](/files/VsOMqTVd8xyulzlhgWoZ)

In the **Command or AutoLISP** field you now type in your AutoCAD command. The example below shows the LINE command. ^C^C means, that a previous command will be canceled. Since a command can also be a transparent command (e.g. using the Zoom command within a Line command) you should always use ^C twice. The \_ means, that the following command will be in English. This way, the command can be executed in any AutoCAD language version. The dot will execute the command even if the command was deleted (using UNDEFINE).

![](/files/tWiyhNDKn9pAQdMJlvfa)

As always you can edit the **Display Name**. Below the Display name you can limit the command to certain types of drawing. **All** allows you to use the command in any type of AutoCAD drawing. Alternatively, you can select **P\&ID** and/or **Plant 3D** if the command should be available in P\&ID and/or Plant 3D only.

![](/files/O5pGNpTCyHAiZmbMc6Xj)

Under **General Properties** you can select the various AutoCAD properties. Under **Color** you can select the standard AutoCAD colors.

![](/files/JQ5TdqUQgjbvMxADd81D)

At the button you can select **Select Color...** to have more options.

![](/files/bKudx5It4Y1xIfUoV5Ka)

You will be shown the common AutoCAD color selection dialog.

![](/files/VTEbjUwkpo5turQh9EUy)

Under **Layer** you can select a Layer from the current drawing you are in. The Layer settings like color, line type and so on, will also be stored, so the layer can be created in another drawing if the layer doesn't exist.

![](/files/eK6cxfHLPZkOjJXLfZgY)

Under **Linetype** you can also choose the line types of the current drawings. As with the layer settings, the line type settings will also be stored in order to create the same line type in a drawing in case the line type doesn't exist yet.

![](/files/l7oE5MOWD9OYMskC3O5c)

If you select **Other...** you will be shown the standard AutoCAD dialog where you can also load line types which aren't available yet.

![](/files/XMXmndaFEuKRJLXWlQ6h)

Under **Linetype scale** you can enter a line type scale factor.

![](/files/FSt5GoZNrmC6tWZDQmrt)

Under **Lineweight** you can select the line weight you want to use.

![](/files/IDwV85fvh5G0hMLAAlih)

under **Transparency** you have the choice between **ByLayer Transparency** and **Transparency Value**.

![](/files/M8Y0jyFBWv9jaiixeqsf)

With **Transparency Value** you can then use the slider to select a value between 0 and 100%.

![](/files/jAJwDixt29ww4qQnKbdu)

When using **ByLayer Transparency**...

![](/files/u1OuYYPCXM73iPGViclZ)

... the transparency will be used from the layer.

![](/files/RFiMGJ24kRvPSFfePYT2)

Under **Text style** you can select the text style from the style which exist in the current drawing. In this example with the **Line** command it doesn't make sense.

![](/files/qIiNbrj1ANRGABhXBHny)

The same is true for **Dimension style**.

![](/files/mCg79DnkksUxAncNJM3W)

Add the end you see a new **Custom Object** with the default image for AutoCAD commands.

![](/files/zpVxnnTyqnwkAvlQjQZW)

At the end of the process disable the **Edit Mode** again (see [Edit Mode)](/plant-tools/plantexpresstools/how-to-use/symbolspalette/usage/edit-mode.md).

</details>

<details>

<summary>Add AutoLISP Command</summary>

Enable **Edit Mode** first (see [Edit Mode)](/plant-tools/plantexpresstools/how-to-use/symbolspalette/usage/edit-mode.md). Adding **AutoLISP Command** works as adding an **AutoCAD Command**. You use again **Add AutoCAD command or AutoLISP...**.

![](/files/5kPeMfa4FlDDB3qbPa1y)

In the **Command or AutoLISP** you fill out your AutoLISP function. The example below creates a function **PROCESSLINE** with (defun C:PROCESSLINE()(command "SLINE" "S" "Primary Style" (getpoint) "N")). This function will execute the AutoCAD Plant 3D **SLINE** command and sets the **Primary Style**. The **PROCESSLINE** function will be executed with **PROCESSLINE** at the end. Remark: This chapter doesn't explain the details of creating AutoLISP function. However, it is the same procedure as using AutoCAD Toolpalettes. Since this function is using the **SLINE** command it makes sense to limit this function to **P\&ID** for the drawing type. Also give it a descriptive Display Name. Setting the **General Properties** doesn't make sense when using the **SLINE** command, because the AutoCAD Plant 3D project Setup will determine the **General Properties**.

![](/files/31Na5czGim0CpQa1vr8X)

Now the new **Custom Object** is shown.

![](/files/nHFwv8NGkB2W565F0UEL)

If you want to integrate such a command in the class structure of the **Pipe Line Segments**, then create a **Custom Class** under Pipe Line Segments.

![](/files/sP2TRcrq78CntTU46HKD)

Now you create the function for this class.

![](/files/GoGA8ghONGkEzulUWHWY)

Again, you have the **Custom Object** under the **Custom Class**.

![](/files/bsHUINElmpcWGyQFi88V)

And when you select a parent class like **Pipe Line Segments** you see the **Custom Object** integrated in the **P\&ID** classes.

![](/files/2SmOxLjvV6l9CA5fqw3z)

At the end of the process disable the **Edit Mode** again (see [Edit Mode)](/plant-tools/plantexpresstools/how-to-use/symbolspalette/usage/edit-mode.md). Remark: You can also use out AutoLISP variables and functions (see [Functions for AutoLISP)](/plant-tools/plantexpresstools/how-to-use/functions-for-autolisp.md).

</details>

<details>

<summary>Add AutoCAD Command</summary>

Enable **Edit Mode** first (see [Edit Mode)](/plant-tools/plantexpresstools/how-to-use/symbolspalette/usage/edit-mode.md). You can also add AutoCAD Commands from existing Tool Palettes. This may help to have a faster transition from using Tool Palette to using the SymbolsPalette. You can start the function from the context menu of a **Custom Class**...

![](/files/VcXpXm8s6m99YGfok4ai)

... or by using the context menu on the right side of the SymbolsPalette and select **Add From Tool Palette**.

![](/files/SW11d8MJq00Sxgt1g7kk)

Next a dialog with the available Tool Palettes will open, where you can select the Commands you want to copy to the SymbolsPalette.

![](/files/mSTEn9cM8m0PykstnJxi)

After clicking OK, you will see the Commands on the selected **Custom Class**.

![](/files/OK5a52LvZyvLBaq6kxeT)

If you use **Properties** to edit the commands you will see the standard dialog of the SymbolsPalette with the command and the images.

![](/files/RxKTd18S0YF2JQ9MUDyc)

At the end of the process disable the **Edit Mode** again (see [Edit Mode)](/plant-tools/plantexpresstools/how-to-use/symbolspalette/usage/edit-mode.md).

</details>

<details>

<summary>Edit AutoCAD/AutoLISP Command</summary>

Enable **Edit Mode** first (see [Edit Mode)](/plant-tools/plantexpresstools/how-to-use/symbolspalette/usage/edit-mode.md). To edit an AutoCAD/AutoLISP command, you use the context menu of the **Custom Object**.

![](/files/lkRF69tDw5VwJGQ6C9UR)

This opens the **Edit Custom Object** dialog allowing you to make your changes.

![](/files/AQpl1fs1s6hpd21LPyQt)

At the end of the process disable the **Edit Mode** again (see [Edit Mode)](/plant-tools/plantexpresstools/how-to-use/symbolspalette/usage/edit-mode.md).

</details>

<details>

<summary>Remove AutoCAD/AutoLISP Command</summary>

Enable **Edit Mode** first (see [Edit Mode)](/plant-tools/plantexpresstools/how-to-use/symbolspalette/usage/edit-mode.md). To remove **Custom Objects** you also use the context menu and select **Remove Custom Object**.

![](/files/R0jzvNnkntPdOyTktAIn)

At the end of the process disable the **Edit Mode** again (see [Edit Mode)](/plant-tools/plantexpresstools/how-to-use/symbolspalette/usage/edit-mode.md).

</details>

<details>

<summary>Use AutoCAD/AutoLISP Command</summary>

To execute an AutoCAD/AutoLISP command you simple click on it.

![](/files/vwZvXzOMNG8qyIcJwQfN)

Since we didn't limit the **Line** command to any particular drawing type, we can start drawing the line with the defined **General Properties**.

![](/files/ji56qQ1LNCtshpiSNglY)

When we click on the **Process Line** icon, but the drawing is not of the **P\&ID** drawing type...

![](/files/1GgagB9iTLYbiHSGKbPB)

... you will be shown the following dialog.

![](/files/A0sL3K7uU9RljNzGSVfn)

If you are in a **P\&ID** drawing, the function **PROCESSLINE** will be executed.

![](/files/3iAyn0OWv6U5zMoD9XfF)

</details>
