.NET

Reply
Distinguished Contributor
alex_b
Posts: 399
Registered: ‎08-15-2003
Message 11 of 18 (124 Views)

Re: Unknown command

05-03-2014 01:37 PM in reply to: Alfred.NESWADBA

Hi,

 

Could you try this on your machine?:

 

[YourDriveForCADwork:]

cd [AnyJobDirectory]

"c:\Program Files\Autodesk\AutoCAD 2012 - Deutsch\Acad.exe"

 

If it works, when you try opening a dwg, AnyJobDirectory should be the default in the dialog (on condition sysvar REMEMBERFOLDERS is 0).

 

Thanks,

 

alex

*Expert Elite*
Alfred.NESWADBA
Posts: 9,217
Registered: ‎06-29-2007
Message 12 of 18 (122 Views)

Re: Unknown command

05-03-2014 01:54 PM in reply to: alex_b

Hi,

 

I started AutoCAD 2012, set REMEMBERFOLDERS to 0 and closed it

I modified my BAT file to the following content:

    c:
    cd "\TEMP"
    "\Program Files\Autodesk\AutoCAD 2012 - Deutsch\acad.exe"
Then I started this BAT ==> command _OPEN brings me to "C:\TEMP" as the current folder.

 

- alfred -

-------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at
-------------------------------------------------------------------------
Distinguished Contributor
alex_b
Posts: 399
Registered: ‎08-15-2003
Message 13 of 18 (110 Views)

Re: Unknown command

05-05-2014 05:14 AM in reply to: Alfred.NESWADBA

Hi Alfred,

 

Thank you for the answer and for your time.

Your answer got me thinking and I decided I can't believe that all this is due to differences between OS's or Acad versions, and that it must be something much simpler (it usually is, you know). It may be due to AutoCAD and Windows distancing themselves from MS DOS (batch files etc.), but then why should it run on Win7 and not on XP? 

I have an idea I'll test after the holiday here, and I'll report on the results in a couple of days.

 

Regards,

 

alex

Distinguished Contributor
alex_b
Posts: 399
Registered: ‎08-15-2003
Message 14 of 18 (88 Views)

Re: Unknown command

05-10-2014 10:58 AM in reply to: Alfred.NESWADBA

Hi Alfred,

 

As promised:

I found the problem was historical: the shortcut to the bat file used to launch AutoCAD 2004 was in fact a .pif file, probably inherited from earlier days.

It was copied and modified to launch AutoCAD 2008 and worked without any problems, but it failed to work on AutoCAD 2012. The reasons are unclear at this time, as Microsoft says .pif files should work under XP.

Anyway, replacing the .pif with a regular shortcut to the .bat file solved the problem.

There remain, though, a few minor unclear items:

1. If we use the the 8.3 DOS format ("C:\Progra~1\...") to launch Acad (in the batch file), any form of the LAYER command is command line only, we can't launch the dialog; this does not happen if we use the full quoted path ("C:\Program Files\...") to launch Acad.

2. No matter how we launch Acad, after we Open a drawing the crosshairs freeze (or sometimes are missing alltogether) and only a REGEN (from the menu - the command line is frozen too) restores the input system to normal. This does not happen on the initial drawing (Drawing1) or on any subsequent drawings (after performing the Regen on the first drawing opened).

It seems that AutoCAD does not perform the usual Regen after opening the first drawing and waits for the user to do it. 

 

Thus, there is no more need to use a .NET program to launch Acad, the batch file approach works well enough, the plug-ins load ok, etc.

Of course the whole exercise raised some questions which remain unanswered.

Maybe some Autodesk guru will care to comment on this.

 

Regards,

 

alex

*Expert Elite*
Alfred.NESWADBA
Posts: 9,217
Registered: ‎06-29-2007
Message 15 of 18 (84 Views)

Re: Unknown command

05-10-2014 11:07 AM in reply to: alex_b

Hi,

 

great that you come back with what you found out, thank you!

And yes, I never ever would have thought about pif, too historical :smileywink:

 

>> 1. If we use the the 8.3 DOS format

Is there any reason you need 8.3 file naming? At least I see that as not safe: if you use such a short name on different systems the "Program~1" might point to everything else, but not "C:\Program Files".

 

>> 2. No matter how we launch Acad, after we Open a drawing the crosshairs freeze

Is your application automatically loaded and has some type of form or palette. If so: check one time to start AutoCAD without loading your application and see if the cursor freezes too. I had a case that a control on a palette (which was automatically loaded) grabed the focus.

 

- alfred -

-------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at
-------------------------------------------------------------------------
Distinguished Contributor
alex_b
Posts: 399
Registered: ‎08-15-2003
Message 16 of 18 (81 Views)

Re: Unknown command

05-10-2014 11:19 AM in reply to: Alfred.NESWADBA

Hi Alfred,

 

You answered before I had time to edit a bit my answer (not important).

 

There is no reason to use the DOS format (although in this case it points to the right file and launches Acad).

I just think it very strange that the file name format should cause differences in AutoCAD's behaviour.

 

About the crosshairs problem: there is no connection with my app. Even on a clean launch, without any apps loaded, it happens.

 

Thanks,

 

alex

*Expert Elite*
Alfred.NESWADBA
Posts: 9,217
Registered: ‎06-29-2007
Message 17 of 18 (78 Views)

Re: Unknown command

05-10-2014 11:23 AM in reply to: alex_b

Hi,

 

>> Even on a clean launch, without any apps loaded, it happens.

Well, than I would try now:

  • use another workspace (maybe with startparameter /W)
  • use a profile that has no additional windows active (no property window, no palette, no layer)
  • try with docked command-line
  • use another AutoCAD profile (using parameter /P)

and if all failes, try with another Windows user account so it starts with a brand new profile.

 

Good luck, - alfred -

-------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at
-------------------------------------------------------------------------
Valued Contributor
cdinten
Posts: 61
Registered: ‎11-19-2010
Message 18 of 18 (56 Views)

Re: Unknown command

05-11-2014 11:31 PM in reply to: alex_b

i think this is the problem about File Path. there are 2 different dynamic paths: DllPath and ExePPath, which may varies according to the way they are loaded . i suggest 2 things you check:

1. make sure that your program had really netload the dll correctly. sometimes it may fail.

2. the main app(which shells the autocad and netloads the dll) is in the same dir as the acad.exe and yourAddIn.dll.

and you can put all the relative files in the same dir as acad.exe, then check the result, if still the same problems, we look for other bugs.

may this be helpful to you!

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.