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

Controlling a .net addin via WCF

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
rhesusminus
409 Views, 2 Replies

Controlling a .net addin via WCF

Hi all.

 

We've created som code that works fine when doing everything inside AutoCAD. In .NET we execute som lisp-code using resultbuffer etc., and everything works fine as the command we're using has the CommandFlags.Modal set.

 

However... When running the same function from another program, using WCF, we only get

"Error: Unknown (command-s) failure." on the command line when the lisp-code was about to be executed.

 

Do you know of a way to fix this? Is there some way to use the CommandFlags.Modal for WCF calls?

 

 


Trond Hasse Lie
AutoCAD Electrical and EPLAN expert
Ctrl Alt El
Please select "Accept Solution" if this post answers your question. 'Likes' won't hurt either. 😉
2 REPLIES 2
Message 2 of 3
Balaji_Ram
in reply to: rhesusminus

Hello Trond,

 

I would not expect it to work if you are using the Application.Invoke to call the Lisp code from the WCF callback. Any Editor.Command calls in application context will not work and (command-s) is the equivalent of it in Lisp.

 

Please try using "SendStringToExecute" in your WCF callback. The Editor.command or Application.Invoke should work ok in the document context.

 

The API does provide the "DocumentManager.BeginExecuteInCommandContext" for this purpose, but unfortunately it does not work as expected yet.

We do have this behavior logged in our database and is likely to be addressed soon.

 

Regards,

Balaji 

 

 



Balaji
Developer Technical Services
Autodesk Developer Network

Message 3 of 3
NielsElzen
in reply to: Balaji_Ram

Hi there,

 

is there a version availble where "DocumentManager.BeginExecuteInCommandContext" does work?

I'm trying to implement this. but, as you say, "unfortunately it does not work as expected yet."

 

Thanks

 

Niels van den Elzen

 

 

Niels van den Elzen
Application Developer @ Yellax

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