CAD Posted September 24, 2017 Posted September 24, 2017 Heelloo, Is there a lisp that can make layer manager properties filter All current. with command:currentfilterall see attachment. Quote
Grrr Posted September 24, 2017 Posted September 24, 2017 Heres an "old" thread that might help out. Quote
CAD Posted September 24, 2017 Author Posted September 24, 2017 Hello Grrrr, which code is the right one for me? the link don't know which code? Quote
Grrr Posted September 24, 2017 Posted September 24, 2017 The code in that thread doesn't solve completely your issue, it rather finds how a property filter is created, which could help for your future code. Please attach a sample drawing to test, cause theres also a question do you use "Properties" or "Group" filter. Quote
CAD Posted September 25, 2017 Author Posted September 25, 2017 thanks for yur replay,but is there a lisp for it? to solved it? Quote
Aftertouch Posted September 26, 2017 Posted September 26, 2017 I use this: Executes the command on load of the LSP file: (defun SETLAYERFILTER ( / ) (setvar "cmdecho" 0) (command "UNDO" "BEGIN") (setq i 0) (vlax-for x (vla-get-blocks (vla-get-ActiveDocument (vlax-get-acad-object)))(if (eq (vla-get-IsXref x) :vlax-true)(setq i (1+ i)))) (if (>= i 1)(command "-Layer" "Filter" "Set" "All non-Xref Layers" "")) (command "UNDO" "END") (setvar "cmdecho" 1) (princ) ) (SETLAYERFILTER) Regular command: (defun C:SETLAYERFILTER ( / ) (setvar "cmdecho" 0) (command "UNDO" "BEGIN") (setq i 0) (vlax-for x (vla-get-blocks (vla-get-ActiveDocument (vlax-get-acad-object)))(if (eq (vla-get-IsXref x) :vlax-true)(setq i (1+ i)))) (if (>= i 1)(command "-Layer" "Filter" "Set" "All non-Xref Layers" "")) (command "UNDO" "END") (setvar "cmdecho" 1) (princ) ) When there is a XreF present in the DWG file, AutoCAD auto-creates the layer filter. This command checks if there are XREF's, if so... the filter is also present and thus its set. Quote
CAD Posted September 26, 2017 Author Posted September 26, 2017 Aftertouch, The code work perfect for me, just the one i need, thxxxxxxxxxxx alottt Bedankt!! Quote
Tharwat Posted September 26, 2017 Posted September 26, 2017 @Aftertouch good efforts. I just wanted to pay your attention to an important issue that you may would like to know and to learn from is that since your aim in iteration of Block table is to know if there is any External Reference existed into current drawing then it would be a very good idea to stop iterating though the rest of blocks inside the drawing to get your function working efficiently and faster. Beside that, coding with DXF as long as it is possible would be a great idea as well. Please have a look at the following and I am sure that you can get how the codes working. (while (and (not fnd) (setq blk (tblnext "BLOCK" (not blk))) ) (and (assoc 1 blk) (setq fnd t) (command "-Layer" "Filter" "Set" "All non-Xref Layers" "") ) ) Quote
Aftertouch Posted September 27, 2017 Posted September 27, 2017 @Tharwat, your right. My coding first checks all blocks, and counts all XREF's, where one match would be enough. Thanks for the hint! Quote
Tharwat Posted September 27, 2017 Posted September 27, 2017 @Tharwat, your right. My coding first checks all blocks, and counts all XREF's, where one match would be enough. Thanks for the hint! You are welcome and keep up the good work. 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.