.NET

Reply
Valued Contributor
chockalingam
Posts: 84
Registered: ‎03-06-2012
Message 1 of 3 (391 Views)

Initiate AutoCAD 2013 from Windows Service

391 Views, 2 Replies
11-23-2012 05:15 AM

Hi, 

   I am trying to initiate AutoCAD 2013 through Windows Service using the Following code but i am not getting instance. Can any one help me in this regarding. 

 

 This is what i tried....

 

const string progID = "AutoCAD.Application.19";

AcadApplication acApp = null;
try
{
Type acType = Type.GetTypeFromProgID(progID);
acApp = (AcadApplication)Marshal.GetActiveObject(progID);
acApp.Visible = true;
return acApp;
}
catch
{
try
{
Type acType = Type.GetTypeFromProgID(progID);
acApp = (AcadApplication)Activator.CreateInstance(acType);
acApp.Visible = true;
return acApp;
}
catch (Exception ex)
{
return acApp;
}
}

ADN Support Specialist
Virupaksha.aithal
Posts: 101
Registered: ‎06-15-2011
Message 2 of 3 (335 Views)

Re: Initiate AutoCAD 2013 from Windows Service

11-28-2012 03:30 AM in reply to: chockalingam

Hi

 

Trying to start AutoCAD from windows service is not supported / tested. That said I think you would have much better results using the accoreconsole.exe that comes with AutoCAD 2013. Refer DevTV  “Getting started with AccoreConsole” in DevBlog @ http://adndevblog.typepad.com/autocad/2012/04/getting-started-with-accoreconsole.html

 

Note: Even accoreconsole.exe is not supported / tested under windows service condition



Virupaksha Aithal KM
Developer Technical Services
Autodesk Developer Network

Mentor
khoa.ho
Posts: 224
Registered: ‎09-15-2011
Message 3 of 3 (326 Views)

Re: Initiate AutoCAD 2013 from Windows Service

11-28-2012 06:57 AM in reply to: chockalingam

Hi,

 

Another good resource for AutoCAD 2013 Core Console can be found at the ongoing AU 2012. The class "CP3338 - Using .NET Programming to Create New Possibilities with the AutoCAD® Core Console" of Augusto Goncalves can be found at the link. You also need to create an account to be able to download free documents.

 

-Khoa

 

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!