> 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/calculations/calculate-autocad-properties.md).

# Calculate AutoCAD Properties

Please make sure you read through the [Calculate simple Example](/plant-tools/plantexpresstools/how-to-use/calculations/calculate-simple-example.md) chapter, because we will keep the explanations shorter and you may miss some details.

In this example, the color of a General Instrument Symbol is supposed to be changed to red if the Tag contains a "?". This can be cause when copying a symbol or if the properties of the Tag are incomplete.

![](/files/TnguZm4JMG7ExIHCvt0U)

If we look at the Tag property we see a ? at the end of the Tag.

![](/files/0iHoJni5Gv1L13uipa6Q)

We create a new calculation where we select "General Instrument Symbols" class and we calculate the "Color (Index-no.)". As you can see you can create many other AutoCAD properties like Layer or HyperLink URL.

![](/files/NIfJSbsq6a7N2C1NFKdU)

We use the following expression:

Iif(Contains(\[Tag], '?'), 1, \[#ObjectColorIndex\_DefaultValue])

Contains(\[Tag], '?') checks if the Tag property contains a ?.

Iif(Contains(\[Tag], '?'), 1, \[#ObjectColorIndex\_DefaultValue])

The \[#ObjectColorIndex\_DefaultValue] expression statement returns the value from the symbol's property settings. Besides the Color you can also get all other AutoCAD Properties.

![](/files/SsmkqnIXUvZ0HMBdIYtA)

The Iif(..., 1, \[#ObjectColorIndex\_DefaultValue]) statement returns 1 (red) if the Tag contains a ?. Otherwise it'll returns the value from the symbol properties. Which is the color you would expect if there would be no calculation.

![](/files/UeOxHlROsp5AjSQxakLj)

After clicking on OK we see the expression in the calculation setup dialog.

![](/files/JyvzFunO0iUdR4yWMAMB)

If we click on OK again, we see that the calculation is defined without any error and it is active.

![](/files/wIMevGe3XZGzILaSbSOt)

We save the drawing and see the calculation has been updated without fail.

![](/files/PIAcgoYBA2zHwNcz0MEL)

When we copy the right instrument to the left the instrument will become red instantly.

![](/files/TnguZm4JMG7ExIHCvt0U)

If we now change the Tag, the symbol will become yellow.

![](/files/h4mh9JZXmElG8jGQiCuY)
