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

    相信很多人以前在lisp中写过很多程序,那么如果要在.net中去调用写好的lisp程序怎么弄呢?

    以下是一个简单的例子: 

    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
    ", lispPath);
                curAcadDoc.SendStringToExecute(loadStr, false, false, false);
            }
    }

    以下是lisp中的代码:

    (defun c:tttt()

      (alert  "hello world")

    )

  • 相关阅读:
    表操作
    mysql表的完整性约束
    mysql支持的数据类型
    数据库存储引擎
    Navicat工具、pymysql模块、数据备份
    数据库一
    IO模型
    协成
    线程
    进程
  • 原文地址:https://www.cnblogs.com/swtool/p/SWTOOL_00013.html
Copyright © 2011-2022 走看看