Jump to content

Recommended Posts

Posted

Hi.

 

I wanted to know if there is any lisp that selects annotative blocks

 

Thank you

Posted

why lisp? you can use Qselect > Block >Annotative

Posted

Have you tried doing a Dump of a annotative block and seeing what properties are revealed.

Posted (edited)
(prompt"\n[cmd : SI] - TDK - P.TKCD - CIENCO625")
(defun c:SG (/ sset ssl)
 (setq sset (ssget (list '(0 . "ATTDEF") ))
	ssl (sslength sset)
 )
 (princ (strcat (itoa ssl) " INSERT(s) found !"))
 (command "_.PSELECT" "p" "")
 (princ)
)

(prompt"\n[cmd : SI] - TDK - P.TKCD - CIENCO625")
(defun c:SG1 (/ sset ssl)
 (setq sset (ssget (list '(0 . "ATTRIB") ))
	ssl (sslength sset)
 )
 (princ (strcat (itoa ssl) " INSERT(s) found !"))
 (command "_.PSELECT" "p" "")
 (princ)
)

Edited by SLW210
Added Code Tags
Posted

Yes, as a result I have the following

 

_$ 
"*A2" 
_$ 
((((-1 . <Entity name: -387e2b0>)
   (0 . "DICTIONARY")
   (5 . "2D2")
   (102 . "{ACAD_REACTORS")
   (330 . <Entity name: -387e2b8>)
   (102 . "}")
   (330 . <Entity name: -387e2b8>)
   (100 . "AcDbDictionary")
   (280 . 0)
   (281 . 1)
   (3 . "*A2")
   (350 . <Entity name: -387e2a0>)
 )
)
 (((-1 . <Entity name: -387e3f8>)
    (0 . "DICTIONARY")
    (5 . "2A9")
    (102 . "{ACAD_REACTORS")
    (330 . <Entity name: -387e400>)
    (102 . "}")
    (330 . <Entity name: -387e400>)
    (100 . "AcDbDictionary")
    (280 . 0)
    (281 . 1)
    (3 . "*A2")
    (350 . <Entity name: -387e3e8>)
  )
 )
 (((-1 . <Entity name: -387e580>)
    (0 . "DICTIONARY")
    (5 . "280")
    (102 . "{ACAD_REACTORS")
    (330 . <Entity name: -387e588>)
    (102 . "}")
    (330 . <Entity name: -387e588>)
    (100 . "AcDbDictionary")
    (280 . 0)
    (281 . 1)
    (3 . "*A2")
    (350 . <Entity name: -387e570>)
  )
 )
)
_$ 

 

This lisp I use

 

(defun c:pos (/ ss i ssent objss)
 (setq ss (LM:ss->ent (ssget (list (cons 0 "INSERT")))))
)

;;;----------------------------------------------------------
(defun LM:ss->ent ( ss / i l )
   (if ss
       (repeat (setq i (sslength ss))
           (setq l (cons (IsAnnotative (ssname ss (setq i (1- i)))) l))
       )
   )
)

;;; Argument: an ename or vla-object.
;;; Return T if object is annotative, otherwise nil.
;;;Joe Burke
 (defun IsAnnotative (e)
   (and e
     (setq e (cdr (assoc 360 (entget e))))
     (setq e (dictsearch e "AcDbContextDataManager"))
     (setq e (dictsearch (cdr (assoc -1 e)) "ACDB_ANNOTATIONSCALES"))
     (assoc 350 e)
   )
   (list e) ;; adicione este fragmento
 )

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