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.
Solved! Go to Solution.
Solved by norman.yuan. Go to Solution.
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.
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.