@ SeeMSixty7
You are only checking if there AcadAnnotative -Xdata on the Objects have the AcadAnnotative Xdata information, but these Data will not be deleted when you change the Annotative propertie to false.
(Set Annotative Property of Objetk from True to False, then check the Xdata)
same
@Anonymous
You do not check whether the objects refer to the AnnotativeInformation,
With your code you also get a statement about annotative objects AND objects which once annotative=true (current are =false).
(Set Annotative Property of Object from True to False, then check the programm output)
Note: XDATA:
The Annotative = false property is when no XDatas append *, or if present: The 2nd dottedpair is 1070 = 0.
The Annotative = trtue property is when XDatas append and the 2nd dottedpair 1070 = 1
* XDATA: Poor programming may have deleted the Xdata, but the Dictionary information still exists in the file.
This can create very "funny" effects when further processing the objects or when making copies.
dbroad-Code with a small edit:
;;D. C. Broad, Jr. 5/25/2017
;;Returns T if the drawing has annotative objects
;;Tested with hatch, text, inserts, and dimensions
;;Will not flag annotative text style, dimstyle, or block definitions
;;unless those styles or definitions are referenced or if block definitions contain
;;nested annotative objects.
;;USE: (hasannotativeobjects nil) to look only at entities in model space and layouts.
;; (hasannotativeobjects t) to include objects nested in user block definitions.
;;
;; edit cadffm 5/26/2017
;;
(defun hasannotativeobjects (nested / i ed return)
(VL-CATCH-ALL-APPLY ;;will break loop at the first annotative object
;;warning: all errors will remain hidden within the catch all function.
'(lambda (x)
(vlax-for n x
(if (or nested (= :vlax-true (vla-get-islayout n)))
(vlax-for m n
(and
(= :vlax-true (vla-get-hasextensiondictionary m))
(setq i 0
ed (vla-GetExtensionDictionary m)
)
;;; (repeat (vla-get-count ed)
;;; (if (= (vla-get-name (vla-item ed 0))
;;; "AcDbContextDataManager"
;;; )
;;; (progn
;;; (setq return t)
;;; (exit) ;;stop loop
;;; )
;;; )
;;; (setq i (1+ i))
;;; )
(progn ; edit cadffm 5/26/2017
(setq ed (vl-catch-all-apply 'vla-Item (list ed "AcDbContextDataManager")))
(not (vl-catch-all-error-p ed))
(setq ed (vl-catch-all-apply 'vla-Item (list ed "ACDB_ANNOTATIONSCALES")))
(not (vl-catch-all-error-p ed))
(vlax-for od ed
(if (wcmatch (vla-get-ObjectName od) "*ContextData")
(progn(setq return t)(exit))
)
)
);_progn
)
)
)
)
)
(list ;;block collection
(vla-get-blocks
(vla-get-activedocument
(vlax-get-acad-object)
)
)
)
)
return ;;predicate value
)