Tom - Try commenting out the code that
modifies the contents of the drawing, and
let the code run to simply open the file,
and then save it, without making changes,
and see if the error still occurs.
tom brabant jr wrote:
>
> Tony,
> The document(s) I've been running this on
> are not open, or in use, to the best of
> my knowlege. Just in case, is there a
> function/method/property
> out there for testing this? Maybe someone on
> our network is playing a practical joke!
> Otherwise, that's a slim possiblity.
> And I would think (hope) that the message I'm receiving,
> "error: Automation Error. Description was not provided.",
> suggests some other problem with
>
> (vlax-invoke-method dbxdoc 'save);***
>
> I believe everything relevant is already
> in this thread, but....
> Here is the latest opus, minus the
> directory recurser (the save bombs on
> single drawings.) Also missing is the
> definition of "parse": it is merely a utility
> to decompose a string into a list of tokens.
>
> A couple of things have changed. As per
> your and Frank's advice, vla- functions
> have been replaced with vlax- .
> And a workaround with a saveas ****
> has been added.
>
> We have had some kind of problem,
> possibly related, on another workstation,
> with (vlax-invoke-method dbxdoc 'open pathhandname).
> It was also reporting the same, confounding
>
> "error: Automation Error. Description was not provided."
>
> However, it is so intermittent, I'd almost
> like to leave it out of the discussion.
> Thanks once more, for your attention in this matter.
>
> (defun register ()
> ;RegisterObjectDBX
> (vl-load-com)
> (setq *objectdbx* "ObjectDBX.AxDbDocument")
> (vl-registry-read (strcat "HKEY_CLASSES_ROOT\\" *objectdbx*
> "\\CLSID"))
> (setq server (findfile "AxDb15.dll"))
> ;the following line produces an apparently inoccuous "illegal
> operation" complaint
> ;(startapp "regsvr32.exe" (strcat "/s \"" server "\""))
> ;while using the following shell does not.....
> (command "sh" "c:\\windows\\system\\regsvr32 /s
> D:\\PROGRA~1\\ACAD2000\\AxDb15.dll");Cadd1
> ;(command "sh" "c:\\windows\\system\\regsvr32 /s C:\\PROGRAM
> FILES\\ACAD2000\\AxDb15.dll");damon
> ;????????
> );defun register
> ;the following will be replaced with (mapcar 'process *dfplat*),
> ;{*dfplat* is a list of full paths generated from a recursion down
> ;a directory tree}.
>
> (defun test ()(process (setq pt
> "S:\\lisp\\vl\\tempxrpath\\b1.dwg")))
>
> (setq *newpath* "S:\\lisp\\vl\\tempxrpath\\p1\\")
>
> (defun process (pathhandname)
> (setq dbxdoc
> (vlax-invoke-method
> (vlax-get-acad-object) 'GetInterfaceObject
> "ObjectDBX.AxDbDocument"
> )
> )
> (vlax-invoke-method dbxdoc 'open pathhandname)
> (setq mdl (vlax-get-property dbxdoc 'modelspace))
> (setq lis nil)
> (vlax-for thing mdl (setq lis (cons thing lis)))
> (setq ilis nil)
> (foreach obj lis
> (if (= "AcDbRasterImage" (vlax-get-property obj 'objectname))
> (setq ilis (cons obj ilis))))
> (setq k 0 )
> (while (< k (length ilis))
> (setq imagefile (vlax-get-property (nth k ilis) 'imagefile)
> pieces (parse "\\" imagefile)
> newimagefile (strcat *newpath* (last pieces))
> )
> (vlax-put-property (nth k ilis) 'imagefile newimagefile)
> (setq k (1+ k))
> )
> ;save ***
> ;(vlax-invoke-method dbxdoc 'save)
> ;"error: Automation Error. Description was not provided."
> ;(vlax-invoke-method 'save);
> ;" error: too few arguments"
> ;saveas ****
> (setq plis (parse "\\" pathhandname))
> (setq olddwgname (last plis) pathl (reverse (cdr (reverse plis)))
> newdwgname
> (strcat (apply 'strcat
> (mapcar '(lambda (piece)(strcat piece "\\"))
> pathl)) "imod-" olddwgname
> )
> )
> (vlax-invoke-method dbxdoc 'saveas newdwgname )
> (vlax-release-object dbxdoc)
> )
>
> On Mon, 28 Aug 2000 22:49:09 +0000, Tony Tanzillo
> wrote:
>
> >ObjectDBX will not open a drawing file that's currently
> >open in another drawing editor.
> >
> >You can open a file with the read-only attribute set,
> >but attempting to save it will result in the same error
> >you mentioned. Ditto for the attibutes of the directory
> >containing the file.
> >
> >Generally, if you want to open a file that's open in
> >another AutoCAD session, you should copy the file, and
> >then open the copy. Of course, that precludes saving to
> >the original file, but of course you should never do
> >that if someone else owns the file (e.g. has it open in
> >an AutoCAD session).
> >
> >"CADDee.com" wrote:
> >>
> >> Tony,
> >>
> >> > Make sure that you're not working with a document
> >> > that has been opened in the drawing editor (after
> >> > it's loaded into the AxDbDocuemnt).
> >>
> >> Does this mean that drawings on a network drive can't be opened using
> >> vla-open, if they're opened by another user? I get the same error as Tom
> >> (error: Automation Error. Description was not provided.) when trying to get
> >> information from a drawing opened in another AutoCAD session. Is it
> >> possible to read data from all files in a directory regardless of them being
> >> opened already?
> >>
> >> Thank you,
> >>
> >> James Dee
> >> www.caddee.com
> >
> >--
> >
> >Checkout the AcadX(tm) ActiveX Extension Library at:
> >
> > http://www.caddzone.com/acadx/acadx.htm
> >
> >/*********************************************************/
> >/* Tony Tanzillo Design Automation Consulting */
> >/* Programming & Customization for AutoCAD & Compatibles */
> >/* ----------------------------------------------------- */
> >/* tony.tanzillo@worldnet.att.net */
> >/* http://www.caddzone.com */
> >/*********************************************************/
--
Checkout the AcadX(tm) ActiveX Extension Library at:
http://www.caddzone.com/acadx/acadx.htm
/*********************************************************/
/* Tony Tanzillo Design Automation Consulting */
/* Programming & Customization for AutoCAD & Compatibles */
/* ----------------------------------------------------- */
/* tony.tanzillo@worldnet.att.net */
/* http://www.caddzone.com */
/*********************************************************/