PDA

View Full Version : Adding a filter for annotative blocks.



M. Kubitza
2009-11-12, 06:16 PM
I wrote this little lisp to select blocks w/ layer filter, and run _annoreset on all at once. After running it, at cmd line it says 4 blocks found, 2 were not annotative.

I would like to add a filter to select annotative blocks only. I poked around for a DXF code but was unable to find one, other than something about the second 1070 setting of 0 or 1 ( tried that and didn't work, unless I'm writing it wrong ).

Does anyone know of a way to filter for annotation? Attached is my test dwg and lisp.

Also, critique and constructive criticism is welcome regarding the lisp in general. It is very basic, but I'm just starting to play & learn LISP and this is the first one I've written, so it was a big thing for me at least!! ( Programming has never been my thing. ) :)

irneb
2009-11-16, 08:52 AM
It doesn't seem to be possible using filters. The only way I can see figuring out if the block is annotative, is to check for the ACAD_XDICTIONARY link (code 360). Then inside that there should be a:

(3 . "AcDbContextDataManager") followed by
(360 . <Entity name: #####>) which in turn has
(3 . "ACDB_ANNOTATIONSCALES") followed by
(350 . <Entity name: #####>)This would only be there if the block has been assigned annotative scales. I was thinking maybe it's possible to figure out from the block definition if the block's annotative. But unfortunately I cant seem to see anything in either DXF code or ActiveX properties which indicate this. If someone knows a way of doing so, you could create a filter to check against block names.