Jump to content

Select object by their annotative scale?


Bikey_4

Recommended Posts

There are many objects in a drawing, some of them have 1/30 annotative scale, some at 1/40 and some have both, for example. Is there anyway of selecting objects which have the scale of 1/30?

Link to comment
Share on other sites

This will return a list of all the annotation scales objects are on in your drawing, I'm sure you could tweak it for your purposes.

;; Argument: an ename or vla-object.
;; Return T if object is annotative, otherwise nil.
;;Joe Burke
(defun IsAnnotative (e)
(if (not (eq (type e) 'ENAME))
(setq e (vlax-vla-object->ename e))
)
(if (assoc -3 (entget e '("AcadAnnotative"))) T)
)

(defun annoscale (e)
 (if (and
(not (eq (type e) 'ENAME))
(eq (type e) 'VLA-OBJECT))
   (setq e (vlax-vla-object->ename e))
)
 (if (IsAnnotative e)
   (setq annoscale
  (cdr (assoc 300
	      (entget
     (cdr
       (assoc 340
	      (entget
     (cdr
       (assoc 350
	      
		(entget
     (cdr
       (assoc 350
	      (entget
     (cdr
       (assoc 360
	      (entget
		(cdr
		  (assoc 360 (entget e)))))))))))))))))))
   nil
   )
 )

(defun c:annotativeobjs ( / )
 (setq objSS (mapcar 'cadr (ssnamex (ssget "x"))))
 (setq annoobjs (vl-remove-if-not 'IsAnnotative objss))
 (if annoobjs
   (mapcar 'annoscale annoobjs))
   
 )

Link to comment
Share on other sites

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