Autodesk Civil 3D entities are supported in ArcGIS Pro 2.6 and later. These entities are added to ArcGIS Pro with an advanced symbology. Arcade scripting is used to mimic the default styles in Autodesk Civil 3D.
This advanced symbology is applied automatically when Civil 3D entities are added to a map or scene in ArcGIS Pro. The predefined symbology for these entities is stored in LYRX files that are read when the layer is added. These LYRX files can be modified to customize symbology that follows the standards of your organization, ensuring consistency.
LYRX files
LYRX is a file format created to save and share feature layer definitions.
The LYRX files used by ArcGIS Pro for Civil 3D symbology are found in this location by default:
C:\Program Files\ArcGIS\Pro\Resources\ArcToolBox\Templates\Layers
These files are read automatically and applied for each different entity type. The name of the LYRX file dictates which file is used for the matching entity type, where the LYRX file is prepended with the label “CAD_” followed by the name of the Civil 3D entity type.
For instance, the CAD_Alignment.lyrx file is used to upload the predefined symbology for the alignments into a map; whereas the CAD_Alignment_3D.lyrx file is used to upload the predefined symbology for the alignments into a scene.
Listed below are the files installed by default. If you remove them from that location, ArcGIS Pro will apply a simple default symbology, which will be based on the graphic properties of the AutoCAD layers where those entities are found in Autodesk Civil 3D.
In the same way, if you replace any of these files with your own symbology definition, the new symbology definition will be applied the next time that this Autodesk Civil 3D entity is added to ArcGIS Pro.
Customize a feature layer symbology and set it as the default
The following steps describe how to change the current symbology and save it in a .lyrx file, so the next time that a new entity of that type is loaded, it will use the modified symbology.
This example will show how to change the distance between the stations in the Alignment feature layer, from 10 meters to 15 meters. In addition, you will change the mask of the station, from having two digits (for example, 14+30) to three digits (for example, 1+430) after the plus sign.
This change can be made to the symbology of the Alignment and Alignment Profile, for either maps or scenes. In the following section, I will also show how to save changes that you make to an LYRX file to reuse and share your changes.
The symbology uses the m-value of these feature classes to position the stations along the alignment.
Note: These two changes can easily be required by different groups of engineers.
Change the intervals between stations
These steps describe how to change the interval of the station from 10 to 15 meters.
- From the Contents pane, browse to the Alignment feature layer and click Alignment to access to the symbology definition.
Another way to do so is to right-click the Alignment feature layer and select Symbology.
- Once in the symbology definition, click the Alignment symbol.
- On the Properties tab, select the first definition.
- Scroll down, and expand the Marker Placement group, then click the Drum in the Interval option.
This will open a code editor from where you need to change a value.
- Then select the X to open the editor.
- Arcade code initially checks whether the Type of the alignment is different than Offset and the Style is different than Offsets. These values are read from attributes in the feature class. If the alignment doesn’t have any of those values, apply a number for the interval, in this case, 10, and that is the value that you need to change.
Note: In Autodesk Civil 3D, the default symbology for the alignments renders those with the Offset type without the station, and that is what we are doing here. If the alignment is Offset, it takes the default value of 0, which means no stations will be rendered.
- Replace the value 10 with 15 and click OK to save the changes.
- Click OK in the Set Attribute Mapping
- Click Apply in the Symbology definition window.
- The symbology is refreshed in the map, and you can see that the stations now are rendered every 15 meters.
Change the stations mask from ###00+00.## to ###0+000.##
These steps describe how to move the plus sign to the left and leave three digits to the right.
- From the station definition (that we saw how to access in the previous section), expand the Appearance group and open the drop-down list for Element. Then select the last row, which is empty. This will give you access to the text definition.
- Click the Drum for Text string.
- Then select the X to open the editor
- Expand and review the code.
There are functions used to build the mask for the $measure value.
Currently, the generated mask looks like this: ###00+00.##
- You’ll change the mask to make it look like this: ###0+000.##.
- In line 4, add a 0 to the mask definition ## so it would look like 000.##.
- In line 5, replace 100 with 1000. Then change the mask, removing a 0, so from ###00 so it would look like ###0.
- Click OK to save the changes and close the editor.
- Click OK in the Set Attribute Mapping
- Click Apply in the Symbology definition window.
- The symbology is refreshed in the map, and you can see that the stations now are rendered with the new mask.
Saving the changes and set them as the default symbology
After performing changes to the symbology, they will apply only to the feature layer where you made them. You can make these changes available to be used for other alignments, and they can also become the new default symbology when new alignments are added to the map or other maps.
To do this, you need to save the feature layer definition as a LYRX file.
- From the Contents pane, browse to the Alignment feature layer where you changed the symbology definition and right-click and select Sharing > Save As Layer File.
- Select a directory where you want to save the LYRX file and click Save.
Now that you have the symbology changes saved in a file, you can apply this symbology manually to a feature layer, or you can use this file to overwrite the default symbology definition of ArcGIS Pro for the corresponding Civil 3D entity type.
Applying the LYRX file with the symbology manually
To apply the LYRX file to a specific feature layer, do the following:
- Go to the symbology definition of the feature layer where you want to apply the symbology and select Import symbology.
This will launch the Apply Symbology From Layer geoprocessing tool.
- In the Symbology layer, select the LYRX file that you saved in a previous step, and click Run.
When the tool finishes running, the symbology will be updated in the map.
Apply the LYRX file with the symbology as the new default
To apply the LYRX file as the new default symbology for a specific type of Civil 3D entity, you need to replace the out-of-the-box file with the new one in this folder.
C:\Program Files\ArcGIS\Pro\Resources\ArcToolBox\Templates\Layers
You need to follow the naming convention so the file will be taken by ArcGIS Pro the next time that is needed.
Review the LYRX Files section.
For your example, you need to rename the file to CAD_Alignment.lyrx.
It is a good practice to keep a copy of both the new and the original LYRX files.
If you have customized one or more LYRX files, and later you uninstall ArcGIS Pro, the file with the custom symbology will be uninstalled. And the next time you install ArcGIS Pro, the default symbology will be used. So, you will need to apply your file to that directory again to apply your custom symbology.
Article Discussion: