Tharwat 发表于 2022-7-6 07:31:13

 
Here is what I have read lately about the same theme that you asking about pBe .
 
Interesting thread . http://www.theswamp.org/index.php?topic=38612.msg437172#msg437172
 
Tharwat

pBe 发表于 2022-7-6 07:35:07

 
Thank you for the link Tharwat.
 
Guess the short answer is NO. or maybe NOT YET or even NEVER.
They probably have a good reason for that.
 
I'll investigate further

Tharwat 发表于 2022-7-6 07:37:56

Agreed .

BlackBox 发表于 2022-7-6 07:39:05

 
Cheers!
 
 
Tharwat has already shown you another great example, courtesy of Lee. :wink:
 
To add a bit more to the explanation, here's some additional documentation on SSGET:
 
 
As the "X" option searches the entire drawing database, you must utilize the filter to limit the included entity pointers in the selection set, or you must conditionally filter out what you do not want from the returned selection set... hope that makes sense.

BlackBox 发表于 2022-7-6 07:44:32

You might also want to consider using SSGET's "A" mode:
 

Lee Mac 发表于 2022-7-6 07:46:34

My version:
 

(defun c:xrlayer ( / a b c d layer )      (setq layer "G-XREF")   (while (setq a (tblnext "BLOCK" (null a)))       (if (= 4 (logand 4 (cdr (assoc 70 a))))         (setq b (cons "," (cons (cdr (assoc 2 a)) b)))       )   )   (if (setq c         (ssget "_X"               (list                   (cons 0 "INSERT")                   (cons 2 (apply 'strcat (cdr b)))                   (cons 8 (strcat "~" layer))               )         )       )       (repeat (setq d (sslength c))         (entmod (list (cons -1 (ssname c (setq d (1- d)))) (cons 8 layer)))       )   )   (princ))

pBe 发表于 2022-7-6 07:48:35

Interesting approach Lee, collecting locked layer names and using that for exclusion filter
 
Clever

pBe 发表于 2022-7-6 07:52:20

 
 
Thanks for the info Renderman.
 

Lee Mac 发表于 2022-7-6 07:54:55

 
Thanks pBe, I assume you are referring to my example at theSwamp

pBe 发表于 2022-7-6 08:00:18

Yup.. your new code here used a different approach. Block names.
 
Nice
页: 1 [2]
查看完整版本: Lisp: Put all XREFs on layer "