.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

[C#] Run AutoCAD

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
m-d
Contributor
1817 Views, 5 Replies

[C#] Run AutoCAD

I tryed to run AutoCAD with codes like:

 

Process myProc8;
myProc8 = Process.Start(@"C:\Program Files\AutoCAD 2010\acad.exe");

or:

System.Diagnostics.Process.Start(@"C:\Program Files\AutoCAD 2010\acad.exe");

or:

Process p = new Process();
p.StartInfo.FileName = @"C:\Program Files\AutoCAD 2010\acad.exe";
p.Start();

 

But when AutoCAD starts, show the error, see the attachment "p1", and in command line, see the attachment "p2".

 

How to start AutoCAD with no error and/or with a profile,...

 

 

5 REPLIES 5
Message 2 of 6
m-d
Contributor
in reply to: m-d

Change the debug to release, tryed to run from bin file,... result is the same. Anyone?

Message 3 of 6
OysteinW
in reply to: m-d

I don't know about the second error, but I got the first error recently because I was debugging inside Civil3d while the "Working Directory"-folder in debug-settings was set to AutoCAD install folder. 

 

Try setting "working directory" to "C:\Program Files\AutoCAD 2010\"

 

-Øystein

 

Message 4 of 6
m-d
Contributor
in reply to: OysteinW

Message 5 of 6
OysteinW
in reply to: m-d

I haven't tried starting AutoCAD from an external process like you seem to do here, but the error message is the same.

-Wich was resolved by setting working directory in debug settings for my project, or by setting working directory in the shortcut wich starts my program..

 

But I guess this is equivalent to:

 

 

            Process p = new Process();
            p.StartInfo.WorkingDirectory = @"C:\Program Files\AutoCAD 2010\";
            p.StartInfo.FileName = @"C:\Program Files\AutoCAD 2010\acad.exe";
            p.Start();

            Process p = new Process();            p.StartInfo.WorkingDirectory = @"C:\Program Files\AutoCAD 2010\";
            p.StartInfo.FileName = @"C:\Program Files\AutoCAD 2010\acad.exe";            p.Start();

 

 

(But I haven't tested it).

Message 6 of 6
m-d
Contributor
in reply to: OysteinW

I can`t beleve it! It`s working! No errors! Thanks!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost