C# CAD二次开发输出信息

C# CAD二次开发各种输出信息

using Autodesk.AutoCAD.Runtime;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.EditorInput;
namespace Message
{
    public class Class1
    {
        [CommandMethod("ModalDialog")]
        public void ModalDialog()
        {
            Message("www.baidu.com");
        }

        private void Message(string p)
        {
            Document dc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
            Editor ed = dc.Editor;
            ed.WriteMessage(p);
        }

        [CommandMethod("AlertDialog")]
        public void AlertDialog()
        {
            AlertMessage("www.baidu.com");
        }

        private void AlertMessage(string p)
        {
            Autodesk.AutoCAD.ApplicationServices.Application.ShowAlertDialog(p);
        }

        [CommandMethod("WebMessage")]
        public void WebMessage()
        {
            MessageWeb("http://www.baidu.com");
        }

        private void MessageWeb(string url)
        {
 	        System.Diagnostics.Process.Start("explorer.exe",url);
        }

    }
}

ModalDialog
在这里插入图是片描述
AlertDialog
C# CAD二次开发输出信息_第1张图片
WebMessage
C# CAD二次开发输出信息_第2张图片

你可能感兴趣的:(二次开发)