objDoc.SendCommand failure

objDoc.SendCommand failure

Anonymous
Not applicable
775 Views
3 Replies
Message 1 of 4

objDoc.SendCommand failure

Anonymous
Not applicable

We have some VB6 code to interact with AutoCAD and other custom dlls.  Please note our code does work with previous version of AutoCAD.

The code for the command “objDoc.SendCommand(chr$(27) & chr$(27))” gives our program the error “AutoCAD:[NUMBER]-Invalid Input.”

 

The error is rather fickle as the command works perfectly in other areas of our methods.  This leads me to believe the error is state based.   The state is probably a running configuration where AutoCAD rejects the *cancel* command.  The following are the AutoCAD commands leading into the error.

 

Commands leading to opening of our own document (works fine): Customization file loaded successfully. Customization Group: ACAD

  • Customization file loaded successfully. Customization Group: CUSTOM
  • Customization file loaded successfully. Customization Group: PLANNINGANALYSIS
  • Customization file loaded successfully. Customization Group: MAINTENANCE
  • Customization file loaded successfully. Customization Group: 2DDRAFTING
  • Customization file loaded successfully. Customization Group: HELP
  • Customization file loaded successfully. Customization Group: INDUSTRYMODELTOOLS
  • Customization file loaded successfully. Customization Group: MAPELECTRIC
  • Customization file loaded successfully. Customization Group: AUTODESKSEEK
  • Customization file loaded successfully. Customization Group: MODELDOC
  • Customization file loaded successfully. Customization Group: CONTENTEXPLORER
  • Customization file loaded successfully. Customization Group: EXPRESS
  • Customization file loaded successfully. Customization Group: BIM360
  • Customization file loaded successfully. Customization Group: APPMANAGER
  • Customization file loaded successfully. Customization Group: FEATUREDAPPS
  • Customization file loaded successfully. Customization Group: SKETCHUPIMPORTSKP
  • ...
  • There are no valid MS Jet providers installed......Done.
  • Regenerating model.
  • *Cancel*
  • Initializing [CUSTOM DLL]
  • DLL Path:<[CUSTOM DLL]
  • AutoCAD menu utilities loaded.*Cancel*
  • Command: *Cancel*
  • _RIBBON
  • *Cancel*
  • COMMANDLINE
  • [CUSTOM METHOD]
  • Command:
  • Command:
  • Command:
  • Command: [CUSTOM METHOD OUTPUT]
  • Command:
  • Command: [CUSTOM METHOD]
  • [CUSTOM METHOD OUTPUT]
  • Command:

 

Commands run for our opened document:

  • Opening an AutoCAD 2013 format file.
  • Substituting [simplex.shx] for [HELVH.SHX].
  • Substituting [simplex.shx] for [Cochin].
  • Regenerating model.
  • AutoCAD menu utilities loaded.
  • Command:
  • Autodesk DWG.  This file is a TrustedDWG last saved by an Autodesk application or Autodesk licensed application.
  • Command:
  • Command:

 

Thank you for any help you may provide.

0 Likes
776 Views
3 Replies
Replies (3)
Message 2 of 4

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

What do you try to do?
When you say it was working in previous versions of AutoCAD, which versions where these previous releases ... AND now you are speaking about AutoCAD Map 3D, not just plain AutoCAD.

 

In your list of commands (I guess that is when AutoCAD Map 3D started) I can't see anywhere the error message you descibe ("AutoCAD:[NUMBER]-Invalid Input.").

 

When you send ESC-Codes what do you want to interrupt? Do you want to interrupt the start process of Map 3D?


When you say you have VB6-Code...is your Map 3D running 32bit or 64bit?

 

I guess this thread needs some more explanations 😉

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2026
------------------------------------------------------------------------------------

(not an Autodesk consultant)
0 Likes
Message 3 of 4

Ed__Jobe
Mentor
Mentor

The only other thing I see is this line: There are no valid MS Jet providers installed...

 

That comes from trying to connect to 32bit mdb from 64 bit Autocad. There were a couple of threads recently that had some suggestions on how to deal with it.

Ed


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
How to post your code.

EESignature

0 Likes
Message 4 of 4

TorenTrue
Contributor
Contributor

 

-------------------------------------------------

Greetings Alfred,

 

What do you try to do?

I am trying to run a command from our VB6 customization.

 

Our program sequence:

  1. Run our application
    1. Our application starts AutoCAD
  2. User clicks on a specific button
    1. AutoCAD MAP loads relevant map
    2. objDoc is reassigned to the new current map
    3. Cancel command is sent
      1. [Current error message appears in our program]
    4. Our Custom Method is executed [If everything works]

 

When you say it was working in previous versions of AutoCAD, which versions where these previous releases ... AND now you are speaking about AutoCAD Map 3D, not just plain AutoCAD.

Our program is being updated to integrate with AutoCAD 2015.  We have/had working versions of our application for AutoCAD 2008 thru AutoCAD 2014.

 

In your list of commands (I guess that is when AutoCAD Map 3D started) I can't see anywhere the error message you describe ("AutoCAD:[NUMBER]-Invalid Input.").

The error message appears within OUR vb6 application when it attempts to send the cancel command.  The error itself is what AutoCAD sends back to our application as AutoCAD rejects the input.

 

Our code:

‘************************

On Error GoTo MyMethodErr

                …

                objDoc.SendCommand(chr$(27) & chr$(27))

                …

MyMethodErr:

“MsgBox "MyMethod: " & Err.Source & ": " & Err.Number & " - " & Err.Description”

Resume Done

‘************************

Err.Source prints “AutoCAD” and Err.Description prints “Invalid Input”.   

 

When you send ESC-Codes what do you want to interrupt? Do you want to interrupt the start process of Map 3D?

This is to stop any commands in progress and un-select any selected objects.  The ESC-Codes exist in our previous AutoCAD integrations and the commands work fine.

 

When you say you have VB6-Code...is your Map 3D running 32bit or 64bit?

Our test machines and AutoCAD are 64 bit.  Our application is a 32 bit application that has been made compatible with both 32 bit and 64 bit versions of AutoCAD 2014 and older.

 

Thank you,

0 Likes