Monday, March 28, 2016

NCS Site Layers

This post is brought to you by WareFlix who provided the NCS layer list of site design tools used in this blog post. WareFlix provides who provides a Custom eLearning Platform for Architects, Engineers and Contractors.

Civil 3D is not built for site development. One proof of this is the lack of NCS layers that relate to site design. In order to have them you have to add them yourself. A quick way to add the layers to a Civil 3D is to create a script file. A script file allows you to run a variety of commands from a text file. The first step is to create a list in Excel (or Google Docs) that contains the layers you want to create as well as the layer properties you want to be populated.

A link to the Excel file used may be found at this link.

Once the data is filled out create a new cell with a formula that will add in the layer. It should look similar to this:

="(if (tblsearch ""LAYER"" """ &TRIM(A263)& """)(princ)(command ""-layer"" ""N"" """&TRIM(A263)&""" ""C"" """&TRIM(B263)&""" """&TRIM(A263)&""" ""LT"" """&TRIM(C263)&""" """&TRIM(A263)&""" ""D"" """&TRIM(D263)&""" """&TRIM(A263)&""" """"))"

The result value should be something like this:

(if (tblsearch "LAYER" "C-TINN")(princ)(command "-layer" "N" "C-TINN" "C" "White" "C-TINN" "LT" "Continuous" "C-TINN" "D" "Triangulated irregular network" "C-TINN" ""))

The tblesearch checks to see if the layer exists, if it does nothing is done. If it is not found then the layer is created with the settings in the Excel file. The formula could be changed to just change the properties by replacing the (princ) with a revised second part. So the (princ) would become:

(command "-layer" "C" "White" "C-TINN" "LT" "Continuous" "C-TINN" "D" "Triangulated irregular network" "C-TINN" "" "")

The formual would be:

="(if (tblsearch ""LAYER"" """ &TRIM(A266)& """)(command ""-layer"" ""C"" """&TRIM(B266)&""" """&TRIM(A266)&""" ""LT"" """&TRIM(C266)&""" """&TRIM(A266)&""" ""D"" """&TRIM(D266)&""" """&TRIM(A266)&""" """" """")(command ""-layer"" ""N"" """&TRIM(A266)&""" ""C"" """&TRIM(B266)&""" """&TRIM(A266)&""" ""LT"" """&TRIM(C266)&""" """&TRIM(A266)&""" ""D"" """&TRIM(D266)&""" """&TRIM(A266)&""" """"))"

Then either copy and paste the column E into AutoCAD or paste it in a text document and then save it as a .SCR file like this one:

A link to the final script file may be found at this link.

Then drag and drop the scr file into AutoCAD and it will either create the layers or update them.

There are also other ways to do this such as lisp routines that you find doing Google Searches.

1 comment:

Anonymous said...

I wrote a CSV->Layers routine back in 2011, when first starting to use NCS Layers, that may be of use:



Blog Widget by LinkWithin