> 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/plantlink/how-to-use/link-configurations/create-an-autocad-properties-link.md).

# Create an AutoCAD Properties Link

This chapter describes how AutoCAD Property Links allow modifying AutoCAD properties like Layer, Color, LineType.

A link with the project created during this chapter is at the end of this chapter.

<details>

<summary>Sample Data and Scope</summary>

The table we use in this example has 4 columns. The column **rowid** is shown by default, but doesn't exist in the table. We want to update the AutoCAD **Color** and **Layer** of the P\&ID Symbols and Pipe Line Segments. We will later see, that for Equipment Symbols we use the columns **LayerName** and for Pipe Line Segments we use **LayeName Lines**. As you can see in the two layer columns, you can also use Plant 3D classes and properties which will later be evaluated by PlantLink when needed.

![](/files/Ff27guHYFxuiorMB2GEt)

</details>

<details>

<summary>Setting up the Link Configuration</summary>

This time we will setup two link configurations. One for Equipment symbols and the other for Pipe Line Segments. To setup a link configuration we need to open the main user interface of **PlantLink** from the **PlantTools** ribbon.

![](/files/kGw9VoyyHFlyZmwLazDQ)

Next you click on **New\...** to create a new Link Configuration.

![](/files/vrZNsmvHARZlFgPnSTBp)

This opens the PlantLink Wizard. Since we are using an SQLite database you select **Data Source File:**. For all other data sources you have to use a UDL file. More about this under [Use SQL-Server](/plant-tools/plantlink/how-to-use/link-configurations/use-sql-server.md), [Use MS Access](/plant-tools/plantlink/how-to-use/link-configurations/use-ms-access.md), [Use MS Excel](/plant-tools/plantlink/how-to-use/link-configurations/use-ms-excel.md). Click on **Browse** to open the file selector.

![](/files/FWc9hU6tvp7TRwOEeB26)

In this example, the SQLite database is stored in the **Related Files** folder in our project.

![](/files/RkcQA7JOzb7rhgkM6OWa)

After you click **Open** the Wizard checks if the path to the database file can be change to a relative path. This makes it easier in case you later want to copy the project. Then there is no need to adapt the Link Configuration.

![](/files/kEPIjtq3pYfWrcwEOAgK)

We keep the default selection **Update AutoCAD P\&ID/Plant 3D properties**. The other options will be explained in the following chapters.

![](/files/VPK1TQZ4ihLU72gBt0tm)

Since this table contains equipment catalog data, we select the **Equipment** class to map the data from the table to the equipment properties our P\&ID symbols.

![](/files/oXE0GlnLmoexYkoYQjD3)

You can select Tables and Views from the database file. But in this case there is just one table available.

![](/files/vKqoBUBJ0i4vBSqnkP5B)

Now we need to define the linked fields. This essentially tells PlantLink how to find suitable rows/datasets in the table. It more or less filters the table. In this example, we use the Status from the table.

![](/files/kJJ3QcVIRpl7VL99wVci)

There are some standard Conditions available. We select **= Equals**, because the type of the equipment symbol is used to filter for Status in the table.

![](/files/NUX4pYBfuU3YvWxbH9tg)

Select Type which contains the selection list with the various equipment types in our equipment symbols. The option **Show warning box if no suitable datasets can be found** opens a warning dialog informing you, that PlantLink couldn't find anything based on the linked column/property. **Show only suitable datasets when using 'Assign Data'** later limits the presented rows/datasets to only the ones where the linked columns/properties meet the set conditions. Otherwise the **PlantLink - External Database Viewer** will show all rows/datasets from the table. In this case we don't want to see the database viewer, because we are sure, that for each Status there is just one row in the table.

![](/files/IaztJSSUOgACqw2eTb0d)

Next we define the columns from the table and map them to the AutoCAD properties. The order of the mapping defines the order of the columns when there are multiple choices. Although, this is unlikely for mapping AutoCAD properties, because typically there is just one choice. The option **The layer values in the external database may contain formatted values** needs to be check, because we use class and property names in the table which need to be evaluated. Meaning, that an expression like **\[EngineeringItems.Status]** will result for example in **New**. The option for **In case of unsuccessful mapping** has to options. **do not change the current values of object properties** means, that the current AutoCAD properties of the symbol or line segment will stay as they are in case PlantLink cannot find a suitable row in the table. **use the value from the class symbol as defined in the project configuration** means, that in case PlantLink cannot find a suitable row the AutoCAD settings from project setup will be used.

![](/files/70TdXUz4xBowoC47FR7E)

The option **Behaviour for multiple records** controls what should happen, if there are more than one suitable rows/datasets. The default setting is **Ask User**. In this case the **PlantLink - External Database Viewer** dialog will show up and the user selects the correct row/dataset. When using **Select first matching record** PlantLink will just use the first of the found candidates from the table. Since we don't expect multiple choices in the table, we can set this option to **Select first matching records**.

![](/files/adiCyeNt8DoRDPNTjAum)

You select the column and the AutoCAD property to which the columns should be mapped. Let's start with Color (Index-no.). This AutoCAD property expects color numbers like 1, 2, 3 for red, yellow, green. There is also the option to use RGB in the table.

![](/files/aKS4MH8s8Jo2rbmLrGny)

For **Sync Mode** we use **On drawing save**. This ensures, that the mapping for those properties will be refreshed when the drawing is saved, or closed and saved. So when you close and save your drawing, your mapped properties are up-to-date. More details about **Sync Mode** can be found under [Mapping Options](/plant-tools/plantlink/how-to-use/usage/mapping-options.md).

![](/files/3cgBUquu89CqEsBuwO4R)

As the second mapping we choose the Layername.

![](/files/LJxAlBvMUAvLyqUqUjkL)

Lastly, we define the name of the Link Configuration. The option **Use this Link Configuration in PlantDataManager** tells PlantDataManager if this Link Configuration can also be used in PlantDataManager. Of course, in PlantDataManager we cannot change AutoCAD properties. Therefore, PlantDataManager will automatically ignore **AutoCAD properties** link configurations.

![](/files/uDcwQufDnvmZddu48lfC)

We now see the Link Configuration in the main dialog of PlantLink and it shows **Active**. The Link Configuration appearing in alphabetical order. This can become important when Link Configurations depend on each other and must be executed in a certain order (see [Rename, Edit, Delete, Deactivate Link Configurations](/plant-tools/plantlink/how-to-use/usage/rename-edit-delete-deactivate-link-configurations.md)).

![](/files/uXfpwH6KMiM4qAFb9vLr)

For the **Pipe Line Segments** we need a second link configuration. We start again with **New\...**

![](/files/eNRikvRh6onaKH53Ni7J)

We select the same database file as before.

![](/files/9LtqTpfp3Fs21Abq3w8U)

Again **AutoCAD Properties**.

![](/files/i2fUfSpgAvxjMjpw6Ar9)

This time we select the **Pipe Line Segment** class.

![](/files/HguLNBkDQA3I6b276Fdn)

We select the same table.

![](/files/bXbVqvH9YQVr9GSmpUHa)

We link the same column and property.

![](/files/1qHaKyn2qbPhjkJ73i1o)

For the Layername we now select **LayerName Lines**.

![](/files/2OEDMx1FmgQ1QWjNrw7R)

And finally a name.

![](/files/8mMugtanD5zgyblolu3o)

And now we have two link configurations.

![](/files/7zlOiN68LvSRBk0VTVgT)

</details>

<details>

<summary>Testing the Link Configuration</summary>

When we insert a pump symbols it uses the AutoCAD properties setting from project setup while being inserted.

![](/files/bqrLxHU6zRqEgPoKBPM9)

When the **Assign Tag** dialog is closed we see that the symbol is red and the Layer is the same as the Status.

![](/files/VTb5qNWrsfl0CwoSHRcl)

When changing the Status in the Property Palette...

![](/files/OOQ1iNi8FLkYpp5fI9PN)

...the Color and Layer will change accordingly. Be aware, that the properties change only when your mouse leaves the PropertiesPalette.

![](/files/xzAU9CExODqTkHvZhdqC)

And again with a different Status.

![](/files/5b2IdaPZ2s2AwvTxo06c)

If you type in something which is not in the table...

![](/files/M2LikvHZ6WeO8pmylfP5)

...then the color and layer defined for this symbol in project setup will be used.

![](/files/72aB0FR80HOFocx0v2ZW)

If we draw a Pipe Line Segment, then we see the Status used as the first part of the Layer.

![](/files/ZzNpqbW5ccrWqT4E1C8Q)

After saving the drawing the Color will be updated too, because the saving updates the link configurations.

![](/files/OKWXTwHAluuC1aLCAhJJ)

If you change the Status the Color and layer will be updated again.

![](/files/ZFFcytpdIEcmvz6HphPl)

When editing a Line Number for the Pipe Line Group, the Layer will be updated too.

![](/files/7SDsJV1VrO7dqaE6JR0j)

</details>

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |   |   |   |   |   |   |   |   |   |   |   |   |   |   |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | - | - | - | - | - | - | - | - | - | - | - | - | - | - |
| AutoCAD Multi-Lines or MLINEs work differently than regular Line Types (POLYLINEs). Not just in Plant 3D, but also in standard AutoCAD itself. This section only explains the specialties when you want to use MLINEs. Make sure you read and understand the sections above from this chapter. We concentrate only on handling the Line Styles for MLINEs and POLYLINEs and the coloring. The other AutoCAD settings like LineTypeScale or LineWeight are no different with MLINEs. To use MLINEs in the first place you have to create Pipe Line Segment styles in Project Setup. |   |   |   |   |   |   |   |   |   |   |   |   |   |   |

![](/files/w7nzV6HkuYF0yHtJkg45)

Make sure the Sline type is set to Mline

![](/files/BQTkRBIGMO0GHffgQ4Nf)

And that you selected a MLINE Style. The MLINE Styles will be read from the projSymbolStyle.dwg in your project. That means, you have to make sure, the the MLINE Styles are loaded into this drawing before you can select them in the dialog.

![](/files/elh4sKKml7bspt6Zuw56)

For this example we have the following table.

![](/files/eGxTVFfGBv2AigEzKwEo)

\| **Column** | **Description** | | --- | --- | | Service | This contains the service on which the line type selection is based on. | | Color | This is the color which will be assigned when using POLYLINEs. Assigning a color to a MLINE will not work. | | LayerColor | This is the color which will be assigned to the Layer when using MLINEs. MLINEs will either use the color from the layer unless the colors are already defined in the MLINE Style. Since assigning a color to the MLINE won't work, we need to put the MLINEs on different layers if the MLINE is needed with different colors. |

{% file src="/files/uxsKceFwr0cuSMcM9n54" %}
