Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LISP routine to change Layer State names

2 REPLIES 2
Reply
Message 1 of 3
brandnewrock8
816 Views, 2 Replies

LISP routine to change Layer State names

Hello,

 

I have 2000+ drawings that have either the layer state "LMAN_DWF" or "DWF".  I want all of them to read "DWF" for scripting purposes.  Does anyone know of a LSIP routine that will go into a drawing and change rename a layerstate if it is named incorreclty, but do nothing if it is named correctly?  

 

Does Layer State "DWF" exist?

If Yes, skip file and move on to next file

If No, does Layer State "LMAN_DWF" exist?

if Yes Rename Layer State to "DWF"

If No, skip file and move to next file.

 

Or a LSIP routine that can simply dump a list of all drawings in a directory that contain "LMAN_DWF" as a layer state.  I could then use that list to do a simple script to change the layer state names on those specific files.

 

Thanks!!

2 REPLIES 2
Message 2 of 3
_Tharwat
in reply to: brandnewrock8

Check this out , ...

 

(defun c:Test nil
  (if (layerstate-has "LMAN_DWF")
    (layerstate-rename "LMAN_DWF" "DWF")
  )
  (princ)
)

 Tharwat

Message 3 of 3
devitg
in reply to: brandnewrock8

Please send me a few of such DWG , you can do it to 

 

see attached file 

 

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost