> 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.

![](https://2994090777-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZH2AGHzvPfBW7YdaaGc0%2Fuploads%2Fgit-blob-1f33b511c13e7bbad3069af5ab1aa6e4f2b56777%2FCalculations-18.png?alt=media)

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

![](https://2994090777-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZH2AGHzvPfBW7YdaaGc0%2Fuploads%2Fgit-blob-09a19387d30dccc499871c57e95959668cf42fb2%2FCalculations-19.png?alt=media)

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.

![](https://2994090777-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZH2AGHzvPfBW7YdaaGc0%2Fuploads%2Fgit-blob-a2526aaa88ad23138e3e52b34c17a065f4987900%2FCalculations-20.png?alt=media)

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.

![](https://2994090777-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZH2AGHzvPfBW7YdaaGc0%2Fuploads%2Fgit-blob-1b5a1b79636de651719e5038f4c7f317838b7c35%2FCalculations-61.png?alt=media)

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.

![](https://2994090777-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZH2AGHzvPfBW7YdaaGc0%2Fuploads%2Fgit-blob-9415eb2c73d3428b0b5695a9e4ae623351e3cd45%2FCalculations-21.png?alt=media)

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

![](https://2994090777-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZH2AGHzvPfBW7YdaaGc0%2Fuploads%2Fgit-blob-6b1a2f5c7967a6844927e077f21c90b6b22717e9%2FCalculations-22.png?alt=media)

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

![](https://2994090777-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZH2AGHzvPfBW7YdaaGc0%2Fuploads%2Fgit-blob-776a544a13d5b0ac865847a54031e7af57c5345e%2FCalculations-23.png?alt=media)

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

![](https://2994090777-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZH2AGHzvPfBW7YdaaGc0%2Fuploads%2Fgit-blob-1ed9b19957ff1305abfe0925857c286799e1cf0d%2FCalculations-37.png?alt=media)

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

![](https://2994090777-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZH2AGHzvPfBW7YdaaGc0%2Fuploads%2Fgit-blob-1f33b511c13e7bbad3069af5ab1aa6e4f2b56777%2FCalculations-18.png?alt=media)

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

![](https://2994090777-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZH2AGHzvPfBW7YdaaGc0%2Fuploads%2Fgit-blob-61b758879f0ef55629afc069562ee0b6d0d0684f%2FCalculations-24.png?alt=media)
