AutoCAD 2013/2014/2015

Reply
*Expert Elite*
sbrusco
Posts: 1,148
Registered: ‎07-27-2000
Message 1 of 8 (708 Views)
Accepted Solution

Change Layer Colors on MANY Drawings

708 Views, 7 Replies
01-17-2013 10:33 AM

Hi All,

 

So, a lot of years ago, someone decided on a particular color for a layer and it became the company standard. Today, and many, Many, MANY standard drawings later, it was determined that that layer's color should change. Does anyone have an automated way to change and existing layer's color on all the drawings in a directory and that directory's sub-directories?

 

Or if you have any other suggestions, they are welcome too.

 

TIA,

Sal


You can make a script and use ScriptPro to run that script on a bunch of files. Script writing is very easy and that app is free. I'm assuming it's still available and in 64 bit flavour.
*Expert Elite*
3wood
Posts: 1,057
Registered: ‎03-25-2009
Message 2 of 8 (692 Views)

Re: Change Layer Colors on MANY Drawings

01-17-2013 12:53 PM in reply to: sbrusco

One method:

Add a function in STARTUP of acad.lsp to change the certain layer color.

Then everytime you open a drawing, the layer color will be changed automatically.

 

Valued Mentor
TerryDotson
Posts: 484
Registered: ‎06-06-2010
Message 3 of 8 (688 Views)

Re: Change Layer Colors on MANY Drawings

01-17-2013 12:59 PM in reply to: sbrusco

If you were to consider third party software, ToolPac contains a tool that will optionally rename layers in multiple drawings, also set options such as color, linetype, etc.  The drawings are opened as a database (not in the editor) so they process very quickly.

**Master
dmfrazier
Posts: 2,750
Registered: ‎05-13-2003
Message 4 of 8 (674 Views)

Re: Change Layer Colors on MANY Drawings

01-17-2013 05:44 PM in reply to: 3wood

That's how we do it!:smileyhappy:

*Expert Elite*
mathewk
Posts: 2,750
Registered: ‎07-09-2003
Message 5 of 8 (671 Views)

Re: Change Layer Colors on MANY Drawings

01-17-2013 05:58 PM in reply to: sbrusco
You can make a script and use ScriptPro to run that script on a bunch of files. Script writing is very easy and that app is free. I'm assuming it's still available and in 64 bit flavour.
Matt Kolberg
Cansel - Autodesk Division
http://www.cansel.ca/
*Expert Elite*
sbrusco
Posts: 1,148
Registered: ‎07-27-2000
Message 6 of 8 (641 Views)

Re: Change Layer Colors on MANY Drawings

01-21-2013 11:18 AM in reply to: mathewk

Hi Matt,

 

All the suggestions were workable and i especially like the STARTUP suggestion by 3wood but i really want the existing drawings to be updated. Although the suggestion by Terry to look at ToolPac had me reaching for my wallet, i am always looking for a $0 solution.

 

Anyway, i have been considering ScriptPro for other purposes for a while so i finally downloaded it and wrote the script and it works just fine for me. I have one questions though, is there anyway to use a script to insert "custom" properties into a drawing (ref attached)? The command "DWGPROPS" seems to be only a dialog driven command.

 

Thanks for the final push to ScriptPro.

And thanks to Terry and 3wood for their suggestions also.

 

Sal


*Expert Elite*
M_Hensley
Posts: 1,712
Registered: ‎12-11-2003
Message 7 of 8 (635 Views)

Re: Change Layer Colors on MANY Drawings

01-21-2013 11:28 AM in reply to: sbrusco

You can access the custom properties with lisp, so you could put some line of lisp code in your script. Or get a lisp program that sets your properties then use a script to open each drawing and load the lisp.

 

There are some threads in the customization forum that discuss setting properties with lisp.

http://forums.autodesk.com/t5/Visual-LISP-AutoLISP-and-General/Update-Custom-Drawing-Properties/m-p/...

 

*Expert Elite*
sbrusco
Posts: 1,148
Registered: ‎07-27-2000
Message 8 of 8 (627 Views)

Re: Change Layer Colors on MANY Drawings

01-21-2013 11:52 AM in reply to: M_Hensley

Hi M_Hensley,

 

Thanks for you input. I wasn't sure if i could run list from inside the script so i tried this line and it works.

 

(vla-AddCustomInfo(vla-get-SummaryInfo(vla-get-Database(vla-get-ActiveDocument (vlax-get-Acad-Object))))"seb 130121""Updated Layer Colors")

 

I think i got all i need now so i'm off to the network to do some mass editing.

 

Thanks to all and once again, this ng has been helpful to the nth degree.

 

Sal


Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.