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

# Erstellen Sie einen AutoCAD-Eigenschaftslink

In diesem Kapitel wird beschrieben, wie AutoCAD-Eigenschaftslinks das Ändern von AutoCAD-Eigenschaften wie Layer, Farbe und Linientyp ermöglichen.

Ein Link zu dem in diesem Kapitel erstellten Projekt befindet sich am Ende dieses Kapitels.

<details>

<summary>Beispieldaten und Umfang</summary>

Die Tabelle, die wir in diesem Beispiel verwenden, hat 4 Spalten. Die Spalte **rowid** wird standardmäßig angezeigt, ist jedoch nicht in der Tabelle vorhanden. Wir möchten die AutoCAD **Farbe** und **Ebene** der P\&ID Symbole und Rohrleitungssegmente aktualisieren. Wir werden später sehen, dass wir für Gerätesymbole die Spalten **LayerName** und für Rohrleitungssegmente **LayeName Lines** verwenden. Wie Sie in den beiden Ebenenspalten sehen können, können Sie auch Plant 3D-Klassen und -Eigenschaften verwenden, die später bei Bedarf von PlantLink ausgewertet werden.

![](/files/3o2RPNy1NrCXg8SajEjQ)

</details>

<details>

<summary>Einrichten der Linkkonfiguration</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/AVo8UwQQuWK2shWP8NHE)

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

![](/files/B4PTlUbMB0io7SyrtoXt)

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/de/plantlink/how-to-use/link-configurations/use-sql-server.md), [Use MS Access](/plant-tools/de/plantlink/how-to-use/link-configurations/use-ms-access.md), [Use MS Excel](/plant-tools/de/plantlink/how-to-use/link-configurations/use-ms-excel.md). Click on **Browse** to open the file selector.

![](/files/BLh6enIKa68imUhjXb1U)

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

![](/files/kRp8twPUYZqVCyHu2ojs)

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/csZtWmHPvBsAqZjIIel6)

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

![](/files/aSJtX3LiQWCzMGfOk1Rj)

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/WdSTOYJLw7AQoSY9VhcS)

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

![](/files/3oMrZQXtMunP3f6QQTeN)

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/mMO4BH1aQMVuYlZ7u2Db)

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/K4rqfWJZ943oPHhabybt)

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/46CnLY24NeLnT6GEQrfJ)

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/AGs5rCokZfanV6IWmcOC)

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/x9gbKxhD2ahLh7EllRy8)

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/ODYFP3mATUQTmVg9PYde)

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/de/plantlink/how-to-use/usage/mapping-options.md).

![](/files/1Fz3EQXA683taCPoIzSU)

As the second mapping we choose the Layername.

![](/files/117e9P2fN21mcQwKsLUl)

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/Fi5CH77a1zAQEtEqUuPZ)

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/de/plantlink/how-to-use/usage.md)).

![](/files/eM7usga6wagtcdf1vPKJ)

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

![](/files/QbpCeQ2RWZGPAyczvkSE)

We select the same database file as before.

![](/files/rpEcKT9ztMqIHaiIaINn)

Again **AutoCAD Properties**.

![](/files/TM3LDoctH04XYD2lCAoY)

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

![](/files/X4trtcXcmCYfmlttDlRs)

We select the same table.

![](/files/VxxggPaJg6Hn103vO3E7)

We link the same column and property.

![](/files/LWhMZgjVrXPtXp33Kf8a)

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

![](/files/6Bn25Yf9iCRBAPDwipvw)

And finally a name.

![](/files/udJ4Q9y5eJpilOTOtRm9)

And now we have two link configurations.

![](/files/cXWuGc9cSNYpoSxOG7gP)

</details>

<details>

<summary>Testen der Linkkonfiguration</summary>

Wenn wir ein Pumpensymbol einfügen, verwendet es beim Einfügen die AutoCAD-Eigenschafteneinstellung aus der Projekteinrichtung.

![](/files/SHMOrqbHWDN9q4HeZRik)

Wenn das Dialogfeld **Tag zuweisen** geschlossen wird, sehen wir, dass das Symbol rot ist und der Layer mit dem Status übereinstimmt.

![](/files/Hwtrw6xKnwzv2iDTLgWA)

Wenn Sie den Status in der Eigenschaftenpalette ändern ...

![](/files/fxYc8kK0cMUMoytgHW6t)

... ändern sich Farbe und Ebene entsprechend. Beachten Sie, dass sich die Eigenschaften nur ändern, wenn Sie mit der Maus die PropertiesPalette verlassen.

![](/files/RfIy7saVJoNZEJDqfYLs)

Und wieder mit einem anderen Status.

![](/files/ureHnjJv47YZS2vrecLh)

Wenn Sie etwas eingeben, was nicht in der Tabelle enthalten ist...

![](/files/1tCuD25FbC212td18Jcm)

...dann werden die Farbe und der Layer verwendet, die für dieses Symbol in der Projekteinrichtung definiert wurden.

![](/files/67EHWlNUCgSrnZZ8AKQm)

Wenn wir ein Rohrleitungssegment zeichnen, sehen wir den Status, der als erster Teil der Ebene verwendet wird.

![](/files/Vpx4zmTm9CDum09IoSQP)

Nach dem Speichern der Zeichnung wird auch die Farbe aktualisiert, da beim Speichern die Linkkonfigurationen aktualisiert werden.

![](/files/ekAE0dFUUk0JtZ8UZkuI)

Wenn Sie den Status ändern, werden Farbe und Ebene erneut aktualisiert.

![](/files/L5Ai0opumNclpcfZIcyi)

Beim Bearbeiten einer Leitungsnummer für die Rohrleitungsgruppe wird auch der Layer aktualisiert.

![](/files/VbZhsTfZKxD16blbZopq)

</details>

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |   |   |   |   |   |   |   |   |   |   |   |   |   |   |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | - | - | - | - | - | - | - | - | - | - | - | - | - | - |
| AutoCAD Multilinien oder MLINEs funktionieren anders als normale Linientypen (POLYLINEs). Nicht nur in Plant 3D, sondern auch im Standard-AutoCAD selbst. In diesem Abschnitt werden nur die Besonderheiten erläutert, wenn Sie MLINEs verwenden möchten. Stellen Sie sicher, dass Sie die obigen Abschnitte dieses Kapitels lesen und verstehen. Wir konzentrieren uns nur auf die Handhabung der Linienstile für MLINEs und POLYLINEs und die Farbgebung. Die anderen AutoCAD-Einstellungen wie LineTypeScale oder LineWeight unterscheiden sich bei MLINEs nicht. Um MLINEs überhaupt verwenden zu können, müssen Sie im Projekt-Setup Rohrleitungssegmentstile erstellen. |   |   |   |   |   |   |   |   |   |   |   |   |   |   |

![](/files/W4ejupg2Ea9tyBML2J4x)

Stellen Sie sicher, dass der Sline-Typ auf Mline eingestellt ist.

![](/files/ghamwZBe5idtv4FaCquj)

Und dass Sie einen MLINE-Stil ausgewählt haben. Die MLINE-Stile werden aus der projSymbolStyle.dwg in Ihrem Projekt gelesen. Das heißt, Sie müssen sicherstellen, dass die MLINE-Stile in diese Zeichnung geladen sind, bevor Sie sie im Dialog auswählen können.

![](/files/l4vey1qfL87E180vlwks)

Für dieses Beispiel haben wir die folgende Tabelle.

![](/files/8onb99XcHGsxLvpF64mn)

\| **Spalte** | **Beschreibung** | | --- | --- | | Service | Darin ist der Dienst enthalten, auf dem die Auswahl des Leitungstyps basiert. | | Farbe | Dies ist die Farbe, die bei der Verwendung von POLYLINEs zugewiesen wird. Das Zuweisen einer Farbe zu einer MLINE funktioniert nicht. | | LayerColor | Dies ist die Farbe, die dem Layer zugewiesen wird, wenn MLINEs verwendet werden. MLINEs verwenden entweder die Farbe aus der Ebene, es sei denn, die Farben sind bereits im MLINE-Stil definiert. Da es nicht funktioniert, der MLINE eine Farbe zuzuweisen, müssen wir die MLINEs auf verschiedene Ebenen legen, wenn die MLINE mit unterschiedlichen Farben benötigt wird. |

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