Make certain blocks in drawing annotative, but not others

Make certain blocks in drawing annotative, but not others

kzD1219
Collaborator Collaborator
404 Views
9 Replies
Message 1 of 10

Make certain blocks in drawing annotative, but not others

kzD1219
Collaborator
Collaborator

Just wondering if there is a lisp that will select specific blocks in a drawing and make them annotative, but not all blocks??  I did find a routine that will make all blocks annotative and it works amazingly, but there are some that don't work with an annotative scale.  Would just like to pick and choose which ones we want to convert.  Is there anything like that floating around?

0 Likes
Accepted solutions (1)
405 Views
9 Replies
Replies (9)
Message 2 of 10

pendean
Community Legend
Community Legend
Share with us a DWG with a block or two "that don't work", let us see what you see please, there might just be a simpler fix.
0 Likes
Message 3 of 10

kzD1219
Collaborator
Collaborator

@pendean wrote:
Share with us a DWG with a block or two "that don't work", let us see what you see please, there might just be a simpler fix.

Everything works, we are just converting the blocks in our drawing templates to annotative, but it is time consuming to do one by one.  And I do have a routine to make all of them annotative, but I don't want to make the blocks that are attached to the dimension styles annotative.  

 

Just wondering if there is a routine out there that will just pick blocks from the list and make them annotative instead of ALL of them.

0 Likes
Message 4 of 10

paullimapa
Mentor
Mentor

share the lisp that you do have that makes all blocks annotative so perhaps this can be modified for you to select blocks instead of do all


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 5 of 10

kzD1219
Collaborator
Collaborator

@paullimapa wrote:

share the lisp that you do have that makes all blocks annotative so perhaps this can be modified for you to select blocks instead of do all


It's from another person so not sure it can be modified or not.

0 Likes
Message 6 of 10

komondormrex
Mentor
Mentor

to quickly make selected blocks definition annotative. note that you should add needed annotative scales to each insertion.

(defun c:make_b_def_anno (/  blocks insert_sset name processed)
  (setq blocks (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object)))) 
  (if (setq insert_sset (ssget '((0 . "insert"))))
    (foreach insert (mapcar 'vlax-ename->vla-object (vl-remove-if 'listp (mapcar 'cadr (ssnamex insert_sset))))
      (if (not (member (setq name (vla-get-effectivename insert)) processed))
	(progn (entmod (append (entget (vlax-vla-object->ename (vla-item blocks name)))
			       '((-3 ("AcadAnnotative" (1000 . "AnnotativeData") (1002 . "{") (1070 . 1) (1070 . 1) (1002 . "}"))))
		       )
	       )
	       (setq processed (append processed (list name)))
	)
      )
    )
  )
)

 

0 Likes
Message 7 of 10

kzD1219
Collaborator
Collaborator

@komondormrex wrote:

to quickly make selected blocks definition annotative. note that you should add needed annotative scales to each insertion.

 

(defun c:make_b_def_anno (/  blocks insert_sset name processed)
  (setq blocks (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object)))) 
  (if (setq insert_sset (ssget '((0 . "insert"))))
    (foreach insert (mapcar 'vlax-ename->vla-object (vl-remove-if 'listp (mapcar 'cadr (ssnamex insert_sset))))
      (if (not (member (setq name (vla-get-effectivename insert)) processed))
	(progn (entmod (append (entget (vlax-vla-object->ename (vla-item blocks name)))
			       '((-3 ("AcadAnnotative" (1000 . "AnnotativeData") (1002 . "{") (1070 . 1) (1070 . 1) (1002 . "}"))))
		       )
	       )
	       (setq processed (append processed (list name)))
	)
      )
    )
  )
)

 

That will definitely work for blocks that are on the screen in a drawing, and maybe I am not explaining this correctly.  I need to edit almost every block to be annotative.  Say I wanted these 3 (below), plus a few others within the current drawing, not annotative.  I know I can use BEDIT and go in to each one and select, annotative or not.  I was just hoping there might be a lisp routine that would pop up with the list of blocks within the drawing and you could select which ones you want annotative and which ones you don't.  Kind of like purge.  You can choose to purge certain things or deselect them to not be purged.  Is that a little clearer?  

 

The lisp routine that I attached in a previous post is just missing an option to pick and choose which blocks to leave out of being annotative. 

 

kzD1219_0-1736178953304.png

 


 

0 Likes
Message 8 of 10

paullimapa
Mentor
Mentor
Accepted solution

The attached DDBLKANO.lsp creates a list box on the fly letting you select blocks to make annotative using your Annotative function. But no pictures of the blocks are shown...only the names.

paullimapa_0-1736184343831.png

 


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 9 of 10

kzD1219
Collaborator
Collaborator

@paullimapa wrote:

The attached DDBLKANO.lsp creates a list box on the fly letting you select blocks to make annotative using your Annotative function. But no pictures of the blocks are shown...only the names.

paullimapa_0-1736184343831.png

 


This one is does the trick!  Thanks so much!

0 Likes
Message 10 of 10

paullimapa
Mentor
Mentor

you are welcome...cheers!!!


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes