This code seems to be auditing the current drawing and not the dbxdoc. I think the commented line is the problem line. Any help appreciated. Dean (defun C:xx (/ dbxdoc objname) (if (= (atoi (getvar "AcadVer")) 16) (setq dbxdoc (vla-GetInterfaceObject (vlax-get-acad-object) "ObjectDBX.AxDbDocument.16")) (setq dbxdoc (vla-GetInterfaceObject (vlax-get-acad-object) "ObjectDBX.AxDbDocument")) ) (setq done nil) (setq files (dos_find "h:\\*.dwg" 1)) (foreach file files (vla-open dbxdoc file) (print file) (vla-AuditInfo(vla-get-ActiveDocument(vlax-get-acad-object)):vlax-false) ;;;(vla-AuditInfo (vla-put-ActiveDocument dbxdoc) :vlax-false) (setq done (append done (list file))) ) (vlax-release-object dbxdoc) (print done) (princ) )
Dean, you are correct....if ObjectDBX supported AuditInfo you would try changing this: (vla-AuditInfo(vla-get-ActiveDocument(vlax-get-acad-object)):vlax-false) to this: (vla-AuditInfo dbxdoc :vlax-false) However, ODBX does NOT support that method so you will need to open each drawing in the editor to run an audit....sorry.
Dean - First, You are confusing two objects: AcadDocument AxDbDocument The former has the AuditInfo method, the latter does not. The reason your code is auditing the active document, is because you're telling it to, by passing the value of the ActiveDocument property to the AuditInfo method. Your commented out line of code is attempting to make a database opened via ObjectDBX the active document, which cannot be done. I don't believe there is any way to audit a database that's not open in the AutoCAD editor.