0 Members and 1 Guest are viewing this topic.
Hi RenderMan,That is exactly what I am lookng for, however, I am very familiar with LISP.I am looking for help on creating one from scratch if I can get some help...
(defun c:frzlay ( ) (LM:ODBX (function (lambda ( doc / lay ) (if (not (vl-catch-all-error-p (setq lay (vl-catch-all-apply 'vla-item (list (vla-get-layers doc) "Your-Layer-Here") ) ) ) ) (vla-put-layeron lay :vlax-true) ) ) ) nil t ) (princ))
Lee your ObjectDBX helper routine is a real time saver.
Lee, I have not been over to your site for some time. I really, really, really like option to preview the code in HTML. Very sweet.And the code looks sweet too. Filed that in back of my brain for when a future need arises.
Thank you Lee Mac for helping me out on the script for “Turning specific layer ON or Off in multiples files without opening them”
It works wonderful, however, I forgot to mentioned that, this specific layer is located on an xreference file
This function will do all of the ObjectDBX work for you:http://lee-mac.com/odbxbase.htmlLoad it and call it with the following program (change the layer name to suit):Code: [Select](defun c:frzlay ( ) (LM:ODBX (function (lambda ( doc / lay ) (if (not (vl-catch-all-error-p (setq lay (vl-catch-all-apply 'vla-item (list (vla-get-layers doc) "Your-Layer-Here") ) ) ) ) (vla-put-layeron lay :vlax-true) ) ) ) nil t ) (princ))The above is untested.
Is it possible to us the following in place of "your-layer-here"?(list (vla-get-layers doc) "*AREA*,UT*|*PATT*,UT*|*DIMS*,UT*|*NOTE*,UT*|*SYMB*,UT*|*SHTT*,BL-0*|*SHTT*,*|A-CLNG-HEAD,*|A-DOOR-CODE,*|*-2,*|*-3")
The current function is looking for an exact layer name match, and cannot accept wildcards.To use wildcards, the code must be changed to:Code: [Select](defun c:frzlay ( ) (LM:ODBX (function (lambda ( doc / lay ) (vlax-for lay (vla-get-layers doc) (if (wcmatch (strcase (vla-get-name lay)) "wildcard-match-here") (vla-put-layeron lay :vlax-true) ) ) ) ) nil t ) (princ))In future, please reply to the forum thread rather than sending a personal message, as the replies will then benefit the whole forum community.
(defun c:frzlay ( ) (LM:ODBX (function (lambda ( doc / lay ) (vlax-for lay (vla-get-layers doc) (if (wcmatch (strcase (vla-get-name lay)) "wildcard-match-here") (vla-put-layeron lay :vlax-true) ) ) ) ) nil t ) (princ))