Layer renaming/creation based on XLS or CSV...

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
AutoCAD v2018
We are in the process of converting Microstation to AutoCAD drawings by the 1000's. The old drawings still have Microstation level names (Level 1, Level 2, Level 3, up to Level 64 I think). We are trying to standardize these drawings to our AutoCAD naming conventions per discipline. Not all the old MS drawings have all the same layers, so the routine needs to first check to see if the layers exist or not. If the old MS layers DOES exist then rename it to the NEW name AND set all the correct layer properties, if it does not, then just create the NEW corresponding layer with all the layer properties (color, line-weight, line-type, transparency, ON/OFF/FROZEN/PLOT, description, etc.) This should allow us to run on processed and unprocessed drawings accordingly without hiccup due to some layers not existing.
Currently we have been running simple lisp to create/fix layers and set all the properties then running our LSP routines, via a SCRIPT using the Autodesk ScriptPro which has been working good. This has worked, but when it comes to checking if layer exist or not, renaming layer, creating layer, I am not versed in lisp enough to do that work.
I think I would like lisp and xls/csv file to be same name
PIPE-LAYER.lsp
PIPE-LAYER.xls
Example of possible xls file
OLD, NEW, COLOR, LW, LT, ON/OFF, FROZEN/THAW, LOCK/UNLOCK, PLOT/NO PLOT, TRANS, DESC
Level 2, Border
Level 3, Piping, Color=3, Lineweight=.40, Linetype=Continuous, On=YES, Frozen=NO, Lock=NO, Plot=YES, Trans=0, Description=Major Process Line
Level 4, Concrete, Color=4, Lineweight=.20, Linetype=Continuous, On=YES, Frozen=NO, Lock=NO, Plot=YES, Trans=0, Description=Concrete Foundations, Slabs, Details, etc.
Level 5, Steel, Color=5, Lineweight=.20, Linetype=Continuous, On=YES, Frozen=NO, Lock=NO, Plot=YES, Trans=0, Description=All NEW Structural Steel
Level 6, Dimensions, Color=7, Lineweight=.13, Linetype=Continuous, On=YES, Frozen=NO, Lock=NO, Plot=YES, Trans=0, Description=All Dimensions
Example...
If Level 2 exist then rename to Border and then set properties
If Level 3 exist then rename to Piping and then set properties
If Level 4 does NOT exist then create Concrete layer and then set properties
If Level 5 exist then rename to Steel and then set properties
If Level 6 does NOT exist then create Dimensions layer and then set properties
I hope I have outlined the need, but if anyone whats to help and needs clarity please let me know. Thank you all in advance.