<< Click to Display Table of Contents >> Create an Extended Link |
This chapter describes the use of Extended Links which will NOT map/copy data from a data source. However, the data from the data source will be visible in Data Manager, Properties Palette, Report Creator PlantDataManager, PlantExpressTools Properties Palette and PlantReporter. Those data are like virtual properties.
Extended Links are available only when using a UDL file for connecting to SQL Server, MS Access, or MS Excel.
The example used in this chapter is the same as in the previous Create an Update Link chapter. But instead of using a SQLite database we are using an MS Access database.
A link with the project created during this chapter is at the end of this chapter.
Remark: Do not use SQL keywords as column names. For example, Desc will be a problem, because DESC is for Descending order.
Remark: Do not use spaces in column names when using AutoCAD Plant 3D 2023 or earlier versions. It is no problem with AutoCAD Plant 3D 2024 or higher.
The table we use in this example has 5 columns. We want to bring in the data from the columns ModelNo, Manufacturer, Price, and DescLong into the P&ID properties. This example is supposed to simulate some sort of equipment catalog data.
|
Setting up the Link Configuration
To setup a link configuration we need to open the main user interface of PlantLink from the PlantTools ribbon. Next you click on New... to create a new Link Configuration. This opens the PlantLink Wizard. Since we are using an UDL files you select OleDb data source:. Click on Browse to open the file selector. In this example, we select a UDL file which is stored in the Related Files folder in our project. 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. We change to Extend AutoCAD P&ID/Plant 3D properties. 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. You can select Tables and Views from the database file. But in this case there is just one table available. 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 PIDType from the table. This contains P, W, and T (check with the first image above). There are some standard Conditions available. We select = Equals, because the type of the equipment symbol is used to filter for PIDType in the table. 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. Next we define the columns from the table which we want to see in the Properties Palette and Data Manager. The order of the mapping defines the order of the columns when there are multiple choices. Since PlantLink doesn't map the external columns to PID properties, we don't select a property. However, you can type in an Alias which is later used as the Display Name in the Properties Palette and Data Manager. The option Write back allows you to later edit the mapped values and have them written back into the table (see Mapping Options). For Sync Mode we keep Never, because this option is not important for Extended Link since they always show the current data from the external data source. More details about Sync Mode can be found under Mapping Options. The final result looks like this. 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. 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).
|
Testing the Link Configuration
When we insert a pump symbols now, which has P as a Default Value in project setup, the PlantLink - External Database Viewer will NOT pop up, because currently PlantLink doesn't support the options available for Update Links also for Extended Links. However, we see, that PlantLink shows the first row from the database in the PropertiesPalette. More details about changing and selecting mapped data can be found under Select different row from source. |
Next Chapter: Create AutoCAD Properties Link