Display full version of the post: Freeze Layers containing spaces?

Xsoldier2000
14.07.2008, 20:22
I'm trying to write a script to mass freeze certain layers in my drawings, but because we receive drawings from an architect, they contain spaces (eg. THIS LAYER|Pool Competition$10$1-pool)Any idea how this might be done? As AutoCAD scripts read spaces as an ENTER key I can't just copy/paste the layer name. Also, when I insert a %20 (normally used for a space) AutoCAD reads it as part of the layer name.Any Help?Or maybe I should be looking into a LISP? I honestly don't know the first thing about writing a LISP though.Thanks for any help possible.

Vladimir Michl
14.07.2008, 21:08
There is no need for a LISP - a plain macro:
 _-LAYER _Freeze * *
will work.
You can use spaces in layer names (in scripts) as long as the EXTNAMES variable is set to 1.

Xsoldier2000
14.07.2008, 21:17


Ok, my EXTNAMES is set to 1 (allowing for AutoCAD 2000(+) parameters)An example of my script:-layerF*|Competition Pool$0$SP-CP-WP-2-ROPE f *|s-grid-iden-384When running the script it still stops after the Competition when trying to freeze *|Competition Pool$0$SP-CP-WP-2-ROPE.  (eg. [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile]: FEnter name list of layer(s) to freeze or <select objects>: *|CompetitionNo matching layer names found.)BTW, I am using AutoCAD 2008.Thank you again for any help.Update: I just found this...Will try it our tomorrow.
To quickly replace spaces in layer names use the following VBA macro (use e.g. the _VBASTMT command to run it):
For Each objLayer In ThisDrawing.Layers : objLayer.Name=Replace(objLayer.Name, " ", "_") : Next
Xsoldier20002008-07-14 21:24:51