CAD Forum - tips, tricks, discussion and utilities for AutoCAD, Inventor, Revit and other Autodesk products [www.cadforum.cz] ARKANCE | CONTACT - CZ | SK | EN | DE
Over 1.095.000 registered users (EN+CZ). AutoCAD tips, Inventor tips, Revit tips. Try the new precise Engineering calculator. New AutoCAD 2026 commands and variables.

CAD tip CAD tip # 4416:

Question

CAD 
 %  platform  category 
A
Although space characters are perfectly legal in AutoCAD layer names (as long as EXTNAMES is on), there may be older add-on utilities which do not properly handle layers with spaces.

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
ACAD2000ACAD2004ACAD2006
100% *CAD
13.5.2005    15696×  
applies to: AutoCAD 2000 · AutoCAD 2004 · AutoCAD 2006 ·

See also:
Tip 14526:How to export geometry from AutoCAD DWGs to JSON files and import it back?
Tip 14446:Undocumented options in AutoCAD FIELDs - hyperlinks, hexadecimal or binary format
Tip 14414:Link geo-tagged photos from your mobile phone to AutoCAD DWG maps.
Tip 14402:What is the difference between the BLOCKREPLACE, BREPLACE, REPLACEBLOCK, RIBLOCK and BLKREDEF commands?
Tip 14384:Wrong encoding of XLS/CSV/TXT files exported from CAD. Wrong characters on command line.


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
  



Featuring:
Increase your productivity with our set of BIM add-on functions for Autodesk Revit
CADstudio Revit Tools More info


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