Jump to content

Recommended Posts

Posted

For XREF's, I want to change overlays to attachments. Can someone tell me the dotted pair that denotes which is which?

Posted

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?

Posted
Bit coded group 70 in the block definition table :)

 

(defun GetBlockFlag ( blockname )
 (if (setq def (tblobjname "BLOCK" blockname))
   (cdr
     (assoc 70
       (entget def)
     )
   )
 )
)

Posted

Ah....

 

(70 . 36) = attached

(70 . 44) = overlay

 

Thank You, Domo Arigato, Muchas Gracias, and Cheers...

 

Chuck

Posted

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)
     )
   )
 )
)

Posted

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.

Posted
(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)
     )
   )
 )
)

Posted

You are quick!!!

 

I do like your logic, "AND"ing the values to for isXREF, and isOverlay. Very clever.

 

Thanks again,

Chuck

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...