rkent Posted April 2, 2013 Posted April 2, 2013 (edited) So I have this code that probably came from one of the users here and I wonder if it can be modified to set the layer filter current as part of the routine? If yes please modify or give me a hint. (defun c:XREFNOT ( / xdict dict xrecname ) (vl-load-com) (setq xdict (vlax-vla-object->ename (vla-getextensiondictionary (vla-get-layers (vla-get-activedocument (vlax-get-acad-object)) ) ) ) ) (setq dict (if (setq dict (dictsearch xdict "ACAD_LAYERFILTERS")) (cdr (assoc -1 dict)) (dictadd xdict "ACAD_LAYERFILTERS" (entmakex '( (0 . "dictionary") (100 . "AcDbDictionary") (280 . 0) (281 . 1) ) ) ) ) ) (princ (if (dictsearch dict (setq xrecname "No_Xref_Layers")) (strcat "Layer filter named <" xrecname "> already exists." ) (if (dictadd dict xrecname (entmakex (append '( (0 . "xrecord") (100 . "AcDbXrecord") (280 . 1) ) (list (cons 1 xrecname)) '( (1 . "~*|*") (1 . "*") (1 . "*") (70 . 0) (1 . "*") (1 . "*") (-3 ( "ACAD" (1000 . "( NAME== \"~*|*\" )") ) ) ) ) ) ) (strcat "Created layer filter named <" xrecname ">." ) "Doh! Something horrible happened. " ) ) ) (princ) ) Thanks, rkent Edited April 3, 2013 by SLW210 Code Tags~Not Quote Tags!! Quote
BlackBox Posted April 2, 2013 Posted April 2, 2013 Just use the undocumented "Filter" (or "_FI") option for the -LAYER Command: (command "._-layer" "filter" "set" "[color="red"]YourCaseSensitiveLayerFilterName[/color]" "") Quote
rkent Posted April 2, 2013 Author Posted April 2, 2013 Great, gotta love those undocumented options. Thanks. Quote
BlackBox Posted April 2, 2013 Posted April 2, 2013 Great, gotta love those undocumented options. Thanks. Happy to help, Rkent. FWIW - You might also find this one to be of use: (command "._vplayer" "reMoveoverrides") Quote
rkent Posted April 2, 2013 Author Posted April 2, 2013 BlackBox - is the code I posted yours? I don't remember where it came from and I try to add the source even if it isn't put there by the author. Thanks for vplayer option. Quote
BlackBox Posted April 2, 2013 Posted April 2, 2013 BlackBox - is the code I posted yours? I don't remember where it came from and I try to add the source even if it isn't put there by the author. Not at all; I do recall having interest in this topic, but never did anything about it (par for the course, unfortunately, given my availability). I know that I had come across a post by Lee on the topic in passing, but couldn't tell you if that code is his either... I do not know him to be that big of a fan of the Simpsons though... Perhaps Kruuger? Thanks for vplayer option. Anytime. Quote
Lee Mac Posted April 2, 2013 Posted April 2, 2013 BlackBox - is the code I posted yours? I don't remember where it came from and I try to add the source even if it isn't put there by the author. Looks like code by Michael Puckett (MP): http://www.theswamp.org/index.php?topic=12640.msg155019#msg155019 Quote
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.