首先在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