This post explains how to import a code e.g. “AMA kod”, by reading and matching settings from an external CSV-file. The CSV-file needs to have at least two columns where one is the “AMA kod” and one is e.g. the Civil 3D Code such as Pave1, Base, Slitlager, Bärlager etc.
The workflow works on any external coding or information that we want to set in a Property Set by matching a new property with an existing property in the Property Set. In this case we have a CSV-file Ama-kod.csv in the Swedish version of Naviate C3D 21.3 or newer.
How to add AMA code to Property Set from external CSV-file using Naviate Civil 3D Match Properties command
Make sure to have a dwg containing e.g. solids from the Naviate command Solids from Shape, so they have e.g. the Property Set NV-Corridor added to those solids. Select one of those solids, open the AutoCAD Properties window and view the Extended Data tab. Note that we have a property Code that e.g. has the value Slitlager.
To add a new property to the Property Set, start the PropSetDefine command either by typing it or selecting it in the Naviate Ribbon:
Find the Property set, click “Add Manual Property Definition” and set the new Property up as below.
NOTE! The Property name must match the column name in the CSV-file, in this case: AMA kod.
Select the same solid in the drawing to see that there now is a new empty property:
Open the Naviate Property Palette, select the NV-Corridor Property Set, click Search and then Match Properties from CSV:
In the Swedish version of Naviate C3D 21.3 there is a CSV-file Ama-kod.csv in folder C:\Users\Public\Documents\Symetri\Naviate\Civil3D2021\SWE\Support\CSV
If we open that file in Notepad, we will see that the header has the columns “AMA kod” and “Code”. These two column names need to match with two Properties in our Property Set. The command “Match Properties from CSV” will then for each selected object read the Code property from the NV-Corridor Property Set, then search the Code column in the CSV-file for the same Code and finally import the corresponding “AMA kod” value to the selected object to e.g. set “Ama kod” to DCC.341 for all objects that has Code set to “Slitlager”. See file image below.
NOTE! This file has ; as list separator and Windows Region Settings must be set to the same setting!
Click […] and find and select the file Ama-kod.csv. Then set the settings as below. We will match the Property “Code” in the Property Set “NV-Corridor” with the column “Code” in the csv-file and we will Import matching columns to Property Set “NV-Corridor” (but it does not have to be the same Property Set). Click OK.
Select the same solid in the drawing to see that “AMA kod” now has been set to the corresponding value:
Import the CVS-file into a droplist
To import the same CSV-file into a droplist for the property set, use the following steps:
In Naviate Property Palette, click Manage sets > Import List Definition
Find and select Ama-kod.csv:
Start the Style Manager, PropertySetDefine, click the funnel-icon and find Ama kod below List Definitions. Note that repeated codes get (1) as suffix! Also note that the Description unfortunately is not visible anywhere else than in this window.
For NV-Corridor change Type for Ama kod to List and select list Ama kod:
Ama kod is now a droplist:
Resources
If you have any other topics you would like us to write about, let us know in the comments below.