The method of loading Lisp program in C#.net in CAD

Source: Internet
Author: User

The main thing is to integrate the previous Lisp program into the current. NET menu to do so.

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 ()

{

Set the tag and send Pline

Document Curacaddoc = App. Documentmanager.mdiactivedocument;

String Lisppath = "D:/1.LSP";

String loadstr = String.Format ("(Load \" {0}\ ") tttt\n"/*space after closing Paren!!! */, Lisppath);

Curacaddoc.sendstringtoexecute (Loadstr, False, False, false);

}

}

The following is the code in Lisp:

(Defun c:tttt ()

(Alert "Hello World")

)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.