CHLUCFENG Posted June 8, 2010 Share Posted June 8, 2010 For XREF's, I want to change overlays to attachments. Can someone tell me the dotted pair that denotes which is which? Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted June 8, 2010 Share Posted June 8, 2010 Bit coded group 70 in the block definition table Quote Link to comment Share on other sites More sharing options...
CHLUCFENG Posted June 8, 2010 Author Share Posted June 8, 2010 Thanks, Chuck Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted June 8, 2010 Share Posted June 8, 2010 No worries Chuck Quote Link to comment Share on other sites More sharing options...
CHLUCFENG Posted June 9, 2010 Author Share Posted June 9, 2010 I use this get.lsp fuction from an old AutoLisp book I had: (defun c:get () (SETQ ENT (ENTSEL)) (SETQ ENT1 (ENTGET (CAR ENT))) (SETQ CT 0) (TEXTPAGE) (PRINC "\n ENTGET OF SELECTED ENTITY:") (REPEAT (LENGTH ENT1) (PRINT (NTH CT ENT1)) (SETQ CT (1+ CT))) (princ) ) For the 70 bitcode, I get (70 . 0) for both Xref's that are attached and Xref's that are overlayed. Shouldn't I be getting a different value for one of them? Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted June 9, 2010 Share Posted June 9, 2010 Bit coded group 70 in the block definition table (defun GetBlockFlag ( blockname ) (if (setq def (tblobjname "BLOCK" blockname)) (cdr (assoc 70 (entget def) ) ) ) ) Quote Link to comment Share on other sites More sharing options...
CHLUCFENG Posted June 9, 2010 Author Share Posted June 9, 2010 Ah.... (70 . 36) = attached (70 . 44) = overlay Thank You, Domo Arigato, Muchas Gracias, and Cheers... Chuck Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted June 9, 2010 Share Posted June 9, 2010 Slightly more complex than that... (defun isXRef ( blockname ) (= 4 (boole 1 4 (GetBlockFlag blockname))) ) (defun isOverlay ( blockname ) (= 8 (boole 1 8 (GetBlockFlag blockname))) ) (defun GetBlockFlag ( blockname ) (if (setq def (tblobjname "BLOCK" blockname)) (cdr (assoc 70 (entget def) ) ) ) ) Quote Link to comment Share on other sites More sharing options...
CHLUCFENG Posted June 9, 2010 Author Share Posted June 9, 2010 I did the manual "double click" on all the overlays within some building plans yesterday. I am working on automating that portion for future updates from that architect. Had to start with which parameter to change. I plugged your code into the get function: (defun GetBlockFlag ();\ blockname) (setq blockname (cdr (assoc 2 ENT1))) (if (= (cdr (assoc 0 ENT1)) "INSERT") (progn (setq def (tblobjname "BLOCK" blockname)) (cdr (assoc 70 (entget def))) ) ) ) (defun c:get () (SETQ ENT (ENTSEL)) (SETQ ENT1 (ENTGET (CAR ENT))) (SETQ CT 0) (TEXTPAGE) (PRINC "\n ENTGET OF SELECTED ENTITY:") (REPEAT (LENGTH ENT1) (PRINT (NTH CT ENT1)) (SETQ CT (1+ CT))) (getblockflag) (princ) ) I am still getting an error, but was able to copy/paste portions to the text editor to get the resulting values. I'm still trying to fix it up. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted June 9, 2010 Share Posted June 9, 2010 (defun c:get ( / ss ) ;; Lee Mac (if (setq ss (ssget "_+.:E:S" '((0 . "INSERT")))) (print (GetBlockFlag (cdr (assoc 2 (entget (ssname ss 0)) ) ) ) ) ) (princ) ) (defun GetBlockFlag ( blockname ) ;; Lee Mac (if (setq def (tblobjname "BLOCK" blockname)) (cdr (assoc 70 (entget def) ) ) ) ) Quote Link to comment Share on other sites More sharing options...
CHLUCFENG Posted June 9, 2010 Author Share Posted June 9, 2010 You are quick!!! I do like your logic, "AND"ing the values to for isXREF, and isOverlay. Very clever. Thanks again, Chuck Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted June 9, 2010 Share Posted June 9, 2010 I do like a bit of bitwise logic 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.