.NET

.NET

Reply
Contributor
systemRobert
Posts: 17
Registered: ‎08-17-2011
Message 1 of 3 (149 Views)
Accepted Solution

Autocad feedback to external .net program

149 Views, 2 Replies
03-25-2014 01:34 AM

I've written a C# program which NETLOAD:s a dll in Autocad. It works quite ok with the dll taking inputs with .SendCommand, but i can't figure out a not-really-ugly way of getting feedback from the CommandMethod to my external .net program.

 

Any suggestions would be appreciated.

So, you want AutoCAD to communicate with an external .NET app.

 

Regardless whatever you do in the AutoCAD side (call COM SemdCommand() or do it in other ways), you can make a WCF service call at certain point in AutoCAD side, likely when your command is ended (so, you would handle CommandEnded event), or just directly at the end of code that does some AutoCAd work. The external app hosts the WCF server and receives the AutoCAD's service call with AutoCAD processing feedback passed in.

 

If you are interested in later/newer technoilogy, I wrote an article in my blog on using ASP.NET SignalR technology to get AutoCAD feedback. It was only meant for a concept-proving, but may give you some idea. Using more mature WCF would be safer bet if you are to develop a mission-crtical application.

 

 

 

*Expert Elite*
norman.yuan
Posts: 1,064
Registered: ‎04-27-2009
Message 2 of 3 (127 Views)

Re: Autocad feedback to external .net program

03-25-2014 06:39 AM in reply to: systemRobert

So, you want AutoCAD to communicate with an external .NET app.

 

Regardless whatever you do in the AutoCAD side (call COM SemdCommand() or do it in other ways), you can make a WCF service call at certain point in AutoCAD side, likely when your command is ended (so, you would handle CommandEnded event), or just directly at the end of code that does some AutoCAd work. The external app hosts the WCF server and receives the AutoCAD's service call with AutoCAD processing feedback passed in.

 

If you are interested in later/newer technoilogy, I wrote an article in my blog on using ASP.NET SignalR technology to get AutoCAD feedback. It was only meant for a concept-proving, but may give you some idea. Using more mature WCF would be safer bet if you are to develop a mission-crtical application.

 

 

 

Contributor
systemRobert
Posts: 17
Registered: ‎08-17-2011
Message 3 of 3 (117 Views)

Re: Autocad feedback to external .net program

03-25-2014 07:32 AM in reply to: norman.yuan

I see, I see. I thought maybe I could get the command line info from the outside. I will reconsider my program structure.

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.