How to get the acad.exe path by acad application?

How to get the acad.exe path by acad application?

swaywood
Collaborator Collaborator
3,497 Views
3 Replies
Message 1 of 4

How to get the acad.exe path by acad application?

swaywood
Collaborator
Collaborator

hello everyone,

I want to get the path of acad.exe when CAD is running.

For some reasons, I don't want to get it by accessing the registry.

I found that 'Autodesk. AutoCAD. Applicationservices. Application. Acadapplication' has a path attribute,

but I can't get this path.

Can you help me?

swaywood_0-1631061522410.png

 

0 Likes
Accepted solutions (1)
3,498 Views
3 Replies
Replies (3)
Message 2 of 4

norman.yuan
Mentor
Mentor
Accepted solution

If you write code with C#, it would be fairly easy:

 

public static string GetAcadExePath()

{

  dynamic comCad=Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication;

  return comCad.Path; //or you can use 'comCad.FullName' which is full pathed acad.exe file name.

}

Norman Yuan

Drive CAD With Code

EESignature

Message 3 of 4

swaywood
Collaborator
Collaborator

I had an interview before, but I don't know why I didn't succeed. I succeeded this time. Thank you, Mr. Yuan

0 Likes
Message 4 of 4

1039574776
Enthusiast
Enthusiast

thanks norman.yuan,it's a great deal!

0 Likes