欢迎加我的QQ群:193522571,一起来讨论、交流!

AutoCAD.Net/C#.Net QQ群:193522571 如何在C# NET代码中调用已经加载的LISP代码?

首先在lisp中写好你的代码,这里就搞个最简单的:
(defun c:hello()
(alert "\nhello world!")
)

然后在你的C#代码中加入代码:
ResultBuffer args = new ResultBuffer(new TypedValue((int)LispDataType.Text, "c:hello"));
ResultBuffer result = Application.Invoke(args);
Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;
ed.WriteMessage(result.ToString());

更多CAD二开问题,请加我的QQ群:193522571

posted @ 2021-03-05 09:55  swtool  阅读(311)  评论(0编辑  收藏  举报
欢迎加我的QQ群:193522571,一起来讨论、交流!