CAD Forum - tips, tricks, discussion and utilities for AutoCAD, Inventor, Revit and other Autodesk products [www.cadforum.cz] ARKANCE | CONTACT - CZ | SK | EN | DE
RSS channel - CAD tips RSS tips
RSS discussions

Discussion Discussion forum

?
CAD discussions, advices, exchange of experience

CAD Forum - Homepage CAD discussion forum - ask any CAD-related questions here, share your CAD knowledge on AutoCAD, Inventor, Revit and other Autodesk software with your peers from all over the world. To start a new topic, choose an appropriate forum.

Please abide by the rules of this forum.
This is a peer-to-peer forum. The forum doesn't replace the official direct technical support provided by ARKANCE for its customers.
How to post questions: register or login, go to the specific forum and click the NEW TOPIC button.
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Topic ClosedFreeze Layers containing spaces?

 Post Reply Post Reply
Author
Xsoldier2000 View Drop Down
Newbie
Newbie


Joined: 14.Jul.2008
Status: Offline
Points: 2
Direct Link To This Post Topic: Freeze Layers containing spaces?
    Posted: 14.Jul.2008 at 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.
Back to Top
Vladimir Michl View Drop Down
Moderator Group
Moderator Group

Arkance Systems CZ

Joined: 26.Jul.2007
Location: Czech Republic
Using: Autodesk software
Status: Offline
Points: 2124
Direct Link To This Post Posted: 14.Jul.2008 at 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.
Vladimir Michl (moderator)
ARKANCE - https://arkance.world - Autodesk Platinum Partner
Back to Top
Xsoldier2000 View Drop Down
Newbie
Newbie


Joined: 14.Jul.2008
Status: Offline
Points: 2
Direct Link To This Post Posted: 14.Jul.2008 at 21:17
Ok, my EXTNAMES is set to 1 (allowing for AutoCAD 2000(+) parameters)

An example of my script:

-layer
F
*|Competition Pool$0$SP-CP-WP-2-ROPE f *|s-grid-iden-384

When 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]: F

Enter name list of layer(s) to freeze or <select objects>: *|Competition
No 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



Edited by Xsoldier2000 - 14.Jul.2008 at 21:24
Back to Top

Related CAD tips:


 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down



This page was generated in 0,156 seconds.