.NET

Reply
Mentor
odoshi
Posts: 244
Registered: ‎06-05-2006
Message 1 of 2 (721 Views)

Need to run LISP function synchronously from .NET across multiple drawings

721 Views, 1 Replies
01-03-2012 09:39 AM

I am using the Application.Invoke() method on 2011+ and am finding it to not work well other than from the command line of a single document.

 

When I declare a Commandflag.Session flag for my command, and try calling Invoke using more than one parameter on a new drawing where the command was not run from, it bombs out.

 

So, Drawing1.dwg - Run command

 

A new Drawing2 is opened, saved, and Invoke called to run some LISP, it will fail.

 

Does anyone have experience with this?

 

I did read somewhere that Invoke() may need to be run from a Document context. Does that exclude the Session flag?

 

Thanks,

Mike

 

 

Mike Caruso
Autodesk Certified Instructor - Civil 3D Autodesk Certified Professional 2014, 2015
www.civil3d.guru - Are you ready to be a Guru?
-------------------------------------------
Rockin' Civil 3D 2015 on a 13-inch MacBook Air | Intel i5 | 4GB RAM | 128GB SSD | Intel HD5000
Mentor
odoshi
Posts: 244
Registered: ‎06-05-2006
Message 2 of 2 (713 Views)

Re: Need to run LISP function synchronously from .NET across multiple drawings

01-03-2012 11:55 AM in reply to: odoshi

Forget it :smileyhappy:

 

Using the Interop DLL's and SendCommand will work synchronously if CommandFlag.Session is used.

 

Doh!

Mike Caruso
Autodesk Certified Instructor - Civil 3D Autodesk Certified Professional 2014, 2015
www.civil3d.guru - Are you ready to be a Guru?
-------------------------------------------
Rockin' Civil 3D 2015 on a 13-inch MacBook Air | Intel i5 | 4GB RAM | 128GB SSD | Intel HD5000
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!