CAD Forum - tips, tricks, discussion and utilities for AutoCAD, Inventor, Revit and other Autodesk products []
CZ | EN | DE
Login or
  Visitors: 10729

CAD tip CAD tip # 7193:

Question CAD 
 %  platform  category 
Q - question

How to create DWG layers from a list in CSV/Excel? (and modify layer properties in Excel)

A - answer Using the free utility CS CsvLayers you can automatically create (import) an arbitrary list of layers to your DWG drawing by reading in a text file with layer definitions.

You can create the layer list in Excel (CSV - comma-delimited values format), or type it in a text editor. The list can contain either the layer names only, or also their properties - color, linetype, lineweight, plot/noplot, visibility... Possible already existing layers will be redefined with the properties read from the CSV file.

The requested linetypes must be preloaded or they are autoloaded from the default .LIN file. Colors are supported both from the ACI palette (indexed) or as truecolors (specified as a "(R G B)" triplet). The parameters you don't want to set can be omitted.

You can download the application CsvLayers from Download. Load it with APPLOAD and type the CSVLAYERS command.

An example of the layer definition file:

;CsvLayers sample file
;Expected format:  
MyHidden,4,Dashed,1,1,1,25,"This will be hidden,OK?",50
GreenishLayer,(34 156 27)
Ceske Budejovice,,,,,,,My hometown

Created layers

The command LAYERS2CSV can export the CSV layer definition file from your existing drawing. You can then modify the list in Excel and re-import it to your AutoCAD DWG.

Enclose descriptions in double quotes ("") to include commas. You can preset your own delimiter by setting:

(setq _CSVdelimiter ";")

100% *  CAD 
29.1.2010    33100×  

See also:
Tip 13855:DBXscanLayers and DBXscanBlocks - bulk report content of DWG files in a folder.
Tip 13688:How to select all DWG objects of a certain type in AutoCAD LT? (texts, circles...)
Tip 13435:Bulk setting of layer properties according to the object in that layer.
Tip 13337:How to select blocks by attribute values? (SelByAttr)
Tip 13014:StickLay - unchangable, fixed layers for selected DWG objects.

Back   All CAD Tips

Have we helped you? If you want to support the CAD Forum web service, consider buying one of our CAD applications, or our custom software development offerings, or donating via PayPal (see above). You may also add a link to your web - like this "fan" link: CAD Forum - tips, utilities, blocks for Autodesk products
CAD:    OS:    Categ: 
Text:  FAQ glossary   

Export 3D VRML scenes from AutoCAD and Inventor
VRMLout More info

Please use these tips at your own risk.
Arkance Systems is not responsible for possible problems that may occur as a result of using any of these tips.