CommandFlags in LispFunction

CommandFlags in LispFunction

ahmedshawkey95
Advocate Advocate
689 Views
1 Reply
Message 1 of 2

CommandFlags in LispFunction

ahmedshawkey95
Advocate
Advocate

Hi

I'm using LispFunction to enable passing parameters. but when I tried to work with multiple documents (close one and open other one) inside the LispFunction, AutoCAD throws exception document is busy.

In CommandMethod I was using CommandFlags.Session to fix that. but i couldn't find an alternative in LispFunction.

 

         [LispFunction("PRINTDWGS")]
        public static void PrintDWGs(ResultBuffer rbArgs)
        {
              Application.DocumentManager.CloseAll();
             Document doc = Application.DocumentManager.Open("C:\\test.dwg");
        }
0 Likes
690 Views
1 Reply
Reply (1)
Message 2 of 2

_gile
Consultant
Consultant

Hi,

 

AutoLISP runs per-document only.

You can open an existing document or create a new one from a LISP function, but this function cannot continue its execution in this document. This stands for built-in functions as for user defined functions.



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub