Paulvth Posted January 12, 2017 Share Posted January 12, 2017 Hey guys, I'm all new to lisp commands but really need a favor I'm using layer translator to convert all layers conaining "*DIM" to layer 0" "*BAS" to layer "basewall" "*EQP" to layer "equipment" etc. etc. etc. is it possible to create a lisp, because i have over 100 drawings to do.... i don't won't to open laytr every time and type all the "*xxx" and select the new layer from my .dws file... every drawing has different layer names but the layers contain the letters "*DIM" /*BAS" "*XXX" etc. thanks for help in advance!!! Quote Link to comment Share on other sites More sharing options...
Paulvth Posted January 12, 2017 Author Share Posted January 12, 2017 The program assumes the user is conversant in writing scripts for AutoCAD ,.... and i'm not Quote Link to comment Share on other sites More sharing options...
OMEGA-ThundeR Posted January 12, 2017 Share Posted January 12, 2017 I thought i asked something like this before... does http://www.cadtutor.net/forum/showthread.php?81400-Using-wildcards-(*)-in-lisp-routine work for you? Quote Link to comment Share on other sites More sharing options...
Paulvth Posted January 12, 2017 Author Share Posted January 12, 2017 doesn't do the job yet... i tried the following; (defun c:layname ( ) (vlax-for layer (vla-get-layers (vla-get-activedocument (vlax-get-acad-object))) (if (wcmatch (strcase (vla-get-name layer)) "*BAS*") (vl-catch-all-apply 'vla-put-name (list layer "I-BASEWALL")) (vlax-for layer (vla-get-layers (vla-get-activedocument (vlax-get-acad-object))) (if (wcmatch (strcase (vla-get-name layer)) "*SUR*") (vl-catch-all-apply 'vla-put-name (list layer "I-SURROUNDING")) ) ) (princ) ) (vl-load-com) (princ) in layertranlator i use *BAS and press select to locate all the layers with BAS in them... then press on the new layer and then the translate button... i want to get the same stuff in a lisp because its a lot of layers to translate and a lot of files... plz help! Quote Link to comment Share on other sites More sharing options...
SLW210 Posted January 12, 2017 Share Posted January 12, 2017 Please read the Code Posting Guidelines and edit your Code to be included in Code Tags.[NOPARSE] Your Code Here[/NOPARSE] = Your Code Here Quote Link to comment Share on other sites More sharing options...
BIGAL Posted January 13, 2017 Share Posted January 13, 2017 You can do the 100 in one go using a script Open dwg1 (load "myfixup") close Y Open dwg2 (load "myfixup") close Y The myfixup lisp would have a list of pairs ((oldname newname)(oldname newname)) then just use a ssget "X" to get all objects and you can simply do a chprop LA ss newname. Do you know anything about lisp and scripts ? Quote Link to comment Share on other sites More sharing options...
Dadgad Posted January 13, 2017 Share Posted January 13, 2017 doesn't do the job yet... i tried the following; (defun c:layname ( ) (vlax-for layer (vla-get-layers (vla-get-activedocument (vlax-get-acad-object))) (if (wcmatch (strcase (vla-get-name layer)) "*BAS*") (vl-catch-all-apply 'vla-put-name (list layer "I-BASEWALL")) (vlax-for layer (vla-get-layers (vla-get-activedocument (vlax-get-acad-object))) (if (wcmatch (strcase (vla-get-name layer)) "*SUR*") (vl-catch-all-apply 'vla-put-name (list layer "I-SURROUNDING")) ) ) (princ) ) (vl-load-com) (princ) in layertranlator i use *BAS and press select to locate all the layers with BAS in them... then press on the new layer and then the translate button... i want to get the same stuff in a lisp because its a lot of layers to translate and a lot of files... plz help! If I am not mistaken, you can save your LAYTRANS mapping, so it is available each time you use the command. You would still need to open the dwgs in order to apply it, and yes, a lisp or a script would do it more quickly and easily. Quote Link to comment Share on other sites More sharing options...
Paulvth Posted January 13, 2017 Author Share Posted January 13, 2017 That's right Dadgad, i can save the mapping information. But in the next dwg the layernames are slightly differtent, but still include the *BAS or *EQP etc. the mapping info only remembers the old layername... and isn't searching for the layers that include these credentials... Sorry BIGAL, i know how to create a lisp copy past the information and use appload... nothing more... (YET) ;P thnx. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.