Anuncios

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

Global edit layer descriptions

Neilw_05
Mentor

Global edit layer descriptions

Neilw_05
Mentor
Mentor

I'm updating our layer template and want to fill out the layer descriptions in more detail. Is there a way to make global edits to descriptions? For example I'd like to use a FIND/REPLACE tool or a RENAME tool with wildcards or export to an external file, make the edits and re-import. Perhaps there is a custom tool out there.

Neil Wilson (a.k.a. neilw)
AEC Collection/C3D 2024, LDT 2004, Power Civil v8i SS1
WIN 10 64 PRO

http://www.sec-landmgt.com
0 Me gusta
Responder
Soluciones aceptadas (2)
2.062 Vistas
16 Respuestas
Respuestas (16)

john.vellek
Alumni
Alumni

Hi @Neilw_05,

 

In the past when I have to do this I created a CSV file that I could edit Easily in Excel. I then used a LISP routine to create the layers and their properties in a new template. I imagine that you could create all the data in a CSV file and then concatenate the cells to form a script and then populate your template that way too.

 

If you give me a handful of your layers and properties I could drop them into a spreadsheet and how you how I do this.


John Vellek


Join the Autodesk Customer Council - Interact with developers, provide feedback on current and future software releases, and beta test the latest software!

Autodesk Knowledge Network | Autodesk Account | Product Feedback
0 Me gusta

Neilw_05
Mentor
Mentor

I'm posting my template (it's Civil 3D 2017). Thanks for having a look!

Neil Wilson (a.k.a. neilw)
AEC Collection/C3D 2024, LDT 2004, Power Civil v8i SS1
WIN 10 64 PRO

http://www.sec-landmgt.com
0 Me gusta

john.vellek
Alumni
Alumni
Solución aceptada

HI @Neilw_05,

 

I dumped a bunch of your layers (over 100) into a spreadsheet and started playing with the concatenation but figured it would be too hard to deal with and too easy to break.

 

So, instead I modified one of my old lisp routines. I have called the new one SECLAYR.lsp. When you load it by typing LAYRSEC, it will open the dialog (defined in  seclayr.dcl).

 

It will present a list of layer setting files to use. Currently  the only one that has your information is the ALL (SECall.csv)

 

When you select that one it will load all of the settings stored in the file as long as the required linetypes are present. There is actually a section in the LSP file that pre-loads some linetypes so you could edit these to reflect yours.

 

So, for this to work I suggest that you place it on your C drive at the root (C:\CADLAYERS) and be added to your file search path and trusted locations in OPTIONS.  You can modify the SECall.csv in Excel which will let you copy/paste, search/replace, etc. This will also allow you to break down the list into parts (see the list of files and names in the dialog box). This might make it easier to work on since you have SO many layers with which to accommodate.

 

I hope this helps. Let me know if this is a possibility for you.

 

Please select the Accept as Solution button if my post solves your issue or answers your question.


John Vellek


Join the Autodesk Customer Council - Interact with developers, provide feedback on current and future software releases, and beta test the latest software!

Autodesk Knowledge Network | Autodesk Account | Product Feedback

Neilw_05
Mentor
Mentor

Your routine works great John. Thank you very much!

 

Questions:

 

1) How do I populate a CSV file with all the layers in my template so I can edit them?

2) I see when I import layers from the other CSV files you included, some of the layers come in preset to No Plot. Where is that coming from?

Neil Wilson (a.k.a. neilw)
AEC Collection/C3D 2024, LDT 2004, Power Civil v8i SS1
WIN 10 64 PRO

http://www.sec-landmgt.com
0 Me gusta

Neilw_05
Mentor
Mentor

One more thing: how do I update the layers that are already in my template? I can't just purge and recreate them because they are already being used by the Civil 3D styles.

Neil Wilson (a.k.a. neilw)
AEC Collection/C3D 2024, LDT 2004, Power Civil v8i SS1
WIN 10 64 PRO

http://www.sec-landmgt.com
0 Me gusta

john.vellek
Alumni
Alumni

Hi @Neilw_05,

 

I am glad you like it. It worked so well for me in the past I removed all layers from our templates entirely!

 

1)  At any rate, I just copy pasted your layer info into the spreadsheet one item at a time to make sure the example came in clean for you. There are a variety of lisp routines that might automate this for you. (Check out the Autodesk App Store perhaps?) You can even just use the old-fashioned -layer ? * at the command line and then grab everything off the text screen but that requires a bit of editing.

2)  The no-plot layers are hard-coded into the lisp routine. I can help you with this if the rest of it works ok.

3) The beauty of this routine is that it will actually reset the layers even if they already exist! It will not remove layers but it will create them and set all the properties to what you have in the CSV files.


John Vellek


Join the Autodesk Customer Council - Interact with developers, provide feedback on current and future software releases, and beta test the latest software!

Autodesk Knowledge Network | Autodesk Account | Product Feedback
0 Me gusta

Neilw_05
Mentor
Mentor

I've managed to generate my CSV file and made some edits. Now I want to test the import process. When I run the LISP I don't see my .csv file in the list. How do I get it to show up? 

Neil Wilson (a.k.a. neilw)
AEC Collection/C3D 2024, LDT 2004, Power Civil v8i SS1
WIN 10 64 PRO

http://www.sec-landmgt.com
0 Me gusta

john.vellek
Alumni
Alumni

Hi @Neilw_05,

 

Make sure the CSV file looks similar to the ones I included. It has a "header" row of Name Color Linetype Description

 

Then open the LISP file (should open with Notepad by default)

 

You will need to add your file name in two places. The first location in the file is where it says (setq lb1info '("ALL" "CEILING" "PHS" "DETAILS-ELEVS-SECT" "BUBBLE" "ROOF" "CIVIL" "LIFE-SAFETY"

 

For example, replace CEILING with NEIL

Just replace one of the names between quotes with the name you want displayed (case sensitive)

 

Then, in the section lower in the file you will see:

(if (= item_name1 "ALL")(setq layersFile "C:\\CADLAYERS\\SECALL.csv"))
(if (= item_name1 "CEILING")(setq layersFile "C:\\CADLAYERS\\Ceiling.csv"))
(if (= item_name1 "PHS")(setq layersFile "C:\\CADLAYERS\\PHS.csv"))
(if (= item_name1 "DETAILS-ELEVS-SECT")(setq layersFile "C:\\CADLAYERS\\Elevation.csv"))
(if (= item_name1 "BUBBLE")(setq layersFile "C:\\CADLAYERS\\Bubble.csv"))
(if (= item_name1 "ROOF")(setq layersFile "C:\\CADLAYERS\\Roof.csv"))
(if (= item_name1 "CIVIL")(setq layersFile "C:\\CADLAYERS\\Civil.csv"))
(if (= item_name1 "LIFE-SAFETY")(setq layersFile "C:\\CADLAYERS\\Lsafe.csv"))

 

Here you will replace CEILING with NEIL and then for the file name put in the exact name of the CSV file you created.

 

Let me know if this makes sense - or send me your csv file and I can make the changes for you.


John Vellek


Join the Autodesk Customer Council - Interact with developers, provide feedback on current and future software releases, and beta test the latest software!

Autodesk Knowledge Network | Autodesk Account | Product Feedback
0 Me gusta

john.vellek
Alumni
Alumni

Hi @Neilw_05,

 

I am checking back to see if you got this to work for your environment. You are welcome to attach your CSV file and I can make the changes in the LSP file for you if you like.


John Vellek


Join the Autodesk Customer Council - Interact with developers, provide feedback on current and future software releases, and beta test the latest software!

Autodesk Knowledge Network | Autodesk Account | Product Feedback
0 Me gusta

Neilw_05
Mentor
Mentor

Hi John,

 

I was busy on a few tasks but I took the time to try your edits. I don't see my CSV file available after I made my edits to the LSP. I've posted my files for your reference.

 

Thanks

Neil Wilson (a.k.a. neilw)
AEC Collection/C3D 2024, LDT 2004, Power Civil v8i SS1
WIN 10 64 PRO

http://www.sec-landmgt.com
0 Me gusta

john.vellek
Alumni
Alumni

Hi Neil,

 

I think it looks fine. I attached my version for you to try also. Make sure that you put the CSV in the C:\CADLAYERS folder so the lisp can find it.

 

When I run LAYRSEC, I see SEC at the bottom of the list (alphabetical)

 

Also, if you have your linetypes in a .LIN file, you can automatically load those with the LISP file as well in the load linetypes section.


John Vellek


Join the Autodesk Customer Council - Interact with developers, provide feedback on current and future software releases, and beta test the latest software!

Autodesk Knowledge Network | Autodesk Account | Product Feedback
0 Me gusta

Neilw_05
Mentor
Mentor

John,

 

I'm still not seeing my layers file. I've closed and re-opened C3D and reloaded the LISP. Screen caps show what I see.

 

 

Neil Wilson (a.k.a. neilw)
AEC Collection/C3D 2024, LDT 2004, Power Civil v8i SS1
WIN 10 64 PRO

http://www.sec-landmgt.com
0 Me gusta

Neilw_05
Mentor
Mentor

My edited version of your latest .LSP attached.

Neil Wilson (a.k.a. neilw)
AEC Collection/C3D 2024, LDT 2004, Power Civil v8i SS1
WIN 10 64 PRO

http://www.sec-landmgt.com
0 Me gusta

john.vellek
Alumni
Alumni
Solución aceptada

Hi Neil - It appears that you are autoloading the Lisp but I am guessing it is a different version (different location). Please remove it from the appload list for now. I would just drag and drop it into your dwg until you have finalized the editing.


John Vellek


Join the Autodesk Customer Council - Interact with developers, provide feedback on current and future software releases, and beta test the latest software!

Autodesk Knowledge Network | Autodesk Account | Product Feedback
0 Me gusta

Neilw_05
Mentor
Mentor

Drag and drop works. I think I am good to go. A big thanks to you for sharing this John.

Neil Wilson (a.k.a. neilw)
AEC Collection/C3D 2024, LDT 2004, Power Civil v8i SS1
WIN 10 64 PRO

http://www.sec-landmgt.com
0 Me gusta

john.vellek
Alumni
Alumni

Hi @Neilw_05,

 

I added your linetypes to the lisp and wrote all your linetypes to the attached file. As long as it is in the path I think this should work well for you.


John Vellek


Join the Autodesk Customer Council - Interact with developers, provide feedback on current and future software releases, and beta test the latest software!

Autodesk Knowledge Network | Autodesk Account | Product Feedback
0 Me gusta