zoukankan      html  css  js  c++  java
  • cad中在c#.net中加载lisp程序的方法

    主要是想将以前的lisp程序整合到现在的.net菜单中才会这么干的

    using Autodesk.AutoCAD.Windows;

    using Autodesk.AutoCAD.Runtime;

    using System.Windows.Forms;

    using Autodesk.AutoCAD.DatabaseServices;

    using Autodesk.AutoCAD.EditorInput;

    using Autodesk.AutoCAD.ApplicationServices;

    using System;

    using System.Collections;

    using app = Autodesk.AutoCAD.ApplicationServices.Application;

    namespace test

    {

            [CommandMethod("test")]

            public void test()

            {

                //设置标记并发送PLINE         

                Document curAcadDoc = app.DocumentManager.MdiActiveDocument;

                string lispPath = "d:/1.lsp";

                string loadStr = String.Format("(load "{0}")  tttt "/*space after closing paren!!!*/, lispPath);

                curAcadDoc.SendStringToExecute(loadStr, false, false, false);

            }

    }

    以下是lisp中的代码:

    (defun c:tttt()

    (alert  "hello world")

    )

  • 相关阅读:
    Leetcode: Reverse Integer
    Leetcode: Two Sum
    Leetcode: Path Sum
    make distclean
    makefile 中 foreach
    nor flash 和 nand flash
    端口(port)的安全模式(security mode)
    单片机入门(二)
    单片机入门(一)
    kworker
  • 原文地址:https://www.cnblogs.com/swtool/p/3832333.html
Copyright © 2011-2022 走看看