error: Automation Error. Description was not provided.

Discussion in 'AutoCAD' started by Rakesh Rao, Feb 9, 2004.

  1. Rakesh Rao

    Rakesh Rao Guest

    Rakesh Rao, Feb 9, 2004
    #1
  2. Rakesh Rao

    John Uhden Guest

    Rakesh:
    That could mean anything for which a specific catch-all-error-message wasn't
    provided. How about narrowing down the possibilities by wrapping each one in a
    catch-all? Better yet, do a dump on the questionable object to see what may not
    be available. My guess is that you might be trying to access something like a
    Land Desktop project without the application being present. A lot of the the
    LDT ActiveX properties and methods return such non-descriptive error messages if
    the needed application is either not loaded or not initialized.

    Posting code can help us to help you too.
     
    John Uhden, Feb 10, 2004
    #2
  3. Rakesh - Visual LISP sometimes fails to obtain the specific
    error message that an ActiveX server returns (and sometimes
    the ActiveX server fails to provide specific error messages),
    so this particular error message is Visual LISP's way of saying
    that it either can't obtain the exact error message, or that
    no specifc error message was provided by the ActiveX server.

    I'm afraid that you will need to indicate what object/method
    or property you're attempting to access in order to determine
    what may be causing the problem.

    John's suggestion will not work, since it has nothing to do
    with (vl-catch-all-xxxxx), as error is in the ActiveX server
    you're using, not in LISP code.



    Copyright (c)2004 Tony Tanzillo
    Unauthorized reproduction expressly prohibited.
     
    Tony Tanzillo, Feb 10, 2004
    #3
  4. Rakesh Rao

    Rakesh Rao Guest

    Hello Tony and John,

    Here is the sample code from AutoCAD Map 2002. I hope this will help you.

    Please note that this error occurs in a drawing that is not the current
    drawing. I open a number of drawings in MDI (Multiple Document
    Interface) mode using the "Open" method of the AutoCAD application and
    this error shows up when it processes one of the open documents.

    (setq
    cRecords (vlax-invoke-method odTable "GetODRecords")
    retVal (vlax-invoke-method cRecords "Init" oname :vlax-false
    :vlax-false)
    )

    (if retVal
    (progn
    (setq cRecord (vlax-invoke-method cRecords "Record")) ))


    The above line ("Record" method call) throws up this error shown below:

    error: Automation Error. Description was not provided.

    Any help is appreciated.

    Regards
    Rakesh


    --

    AutoCAD customization for Engineering/Mapping/GIS
    Get GeoTools @ http://www.4d-technologies.com/geotools
    Build MyGeoTools @ http://www.4d-technologies.com/geotools/my_geotools.htm
    FREE downloads : http://www.4d-technologies.com/techcenter
    </PRE>
     
    Rakesh Rao, Feb 10, 2004
    #4
  5. Rakesh Rao

    Rakesh Rao Guest

    Hi Tony and John,

    Thank you for your answers. I am posting a portion of the code below.
    The trouble is that this error shows up in another (non-current) drawing
    and not the current one. I am using the ActiveX functions to open many
    drawings in the MDI mode and this error shows up in one of the open
    drawings when I attempt to process it.

    I tried the same thing using (vl-catch-all... exception handling
    functions and the same error shows up.



    (setq
    cRecords (vlax-invoke-method odTable "GetODRecords")
    retVal (vlax-invoke-method cRecords "Init" oname :vlax-false
    :vlax-false)
    )

    (if retVal
    (progn
    (setq cRecord (vlax-invoke-method cRecords "Record")) ))


    The above line ("Record" method call) throws up this error shown below:

    error: Automation Error. Description was not provided.

    Any help is appreciated.


    --

    AutoCAD customization for Engineering/Mapping/GIS
    Get GeoTools @ http://www.4d-technologies.com/geotools
    Build MyGeoTools @ http://www.4d-technologies.com/geotools/my_geotools.htm
    FREE downloads : http://www.4d-technologies.com/techcenter
    </PRE>
     
    Rakesh Rao, Feb 10, 2004
    #5
  6. Rakesh - The Record method is failing, but I can't tell you
    why (that can be for any number of reasons).

    Have you tried checking the IsDone property of the ODRecords
    object before you try to call Record, to see if there are any
    records in the collection?



    Copyright (c)2004 Tony Tanzillo
    Unauthorized reproduction expressly prohibited.
     
    Tony Tanzillo, Feb 10, 2004
    #6
  7. Rakesh Rao

    John Uhden Guest

    Sorry, Rakesh. I've never used the Map ActiveX server, but only the ADE*
    functions. Never meant to imply that (vl-catch-all...) would solve your problem
    but rather might help to define the problem in case you weren't sure what call
    returned the error. At this point, since you've combined two calls into one
    (setq), I think you ought run them separately and dump each object if in fact
    they returned, including the odtable and oname objects you haven't disclosed.
     
    John Uhden, Feb 11, 2004
    #7
  8. Just a word of advice. Using (vl-catch-*) functions
    to find the LISP or ActiveX method call that's failng
    isn't the easiest way to go.

    Just replace your default error handler with
    this one:

    (defun *error* (msg)
    (vl-bt)
    (princ (strcat "\nError: " msg))
    (princ)
    )




    Copyright (c)2004 Tony Tanzillo
    Unauthorized reproduction expressly prohibited.
     
    Tony Tanzillo, Feb 11, 2004
    #8
  9. Not sure how vl-catch-* helps in that regards.

    It seems to me that it would be
    a lot easier to just do this:

    (defun *error* (msg) (vl-bt) (princ))



    Copyright (c)2004 Tony Tanzillo
    Unauthorized reproduction expressly prohibited.
     
    Tony Tanzillo, Feb 11, 2004
    #9
  10. Rakesh Rao

    John Uhden Guest

    Have to agree that's easier. Don't know how helpful the report is. I was
    thinking along the lines of dumping the object that was causing the problem, but
    you could do that without (vl-catch...).
     
    John Uhden, Feb 11, 2004
    #10
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.