欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 新闻 > 社会 > 023集——CAD 窗体交互、多段线进行翻转、错误提示(CAD—C#二次开发入门)

023集——CAD 窗体交互、多段线进行翻转、错误提示(CAD—C#二次开发入门)

2024/11/16 5:41:20 来源:https://blog.csdn.net/yongshiqq/article/details/143455098  浏览:    关键词:023集——CAD 窗体交互、多段线进行翻转、错误提示(CAD—C#二次开发入门)

 

 效果如下:

 

 窗体模块:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;namespace AcTools
{public partial class MyForm : Form{public MyForm(){InitializeComponent();}private void button1_Click(object sender, EventArgs e){int num;int.TryParse(textBox1.Text,out num);Z.Drawcir(num);Z.Zoom();}}
}

 主模块

using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.Geometry;
using Autodesk.AutoCAD.Runtime;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using AcTools;
using Autodesk.AutoCAD.EditorInput;
using Autodesk.AutoCAD.Colors;
using System.Runtime.CompilerServices;
using Wform = System.Windows.Forms;
using System.IO;
using System.Windows.Forms;
using Excel=  Microsoft.Office.Interop.Excel.Application;
using Autodesk.AutoCAD.Windows;
//using UserControl = System.Windows.Controls.UserControl;
using System.Windows.Forms.Integration;
using Autodesk.AutoCAD.Internal;
//PaletteSet integrationnamespace AcTools
{public  class Class1{[CommandMethod("xx")]public  void XX(){Z.Zoom();MyForm form = new MyForm();form.Show();Z.Writemessage("已退出");}}
}
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.Geometry;
using Autodesk.AutoCAD.Runtime;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using AcTools;
using Autodesk.AutoCAD.EditorInput;
using Autodesk.AutoCAD.Colors;
using System.Runtime.CompilerServices;
using Wform = System.Windows.Forms;
using System.IO;
using System.Windows.Forms;
using Excel=  Microsoft.Office.Interop.Excel.Application;
using Autodesk.AutoCAD.Windows;
//using UserControl = System.Windows.Controls.UserControl;
using System.Windows.Forms.Integration;
using Autodesk.AutoCAD.Internal;
//PaletteSet integrationnamespace AcTools
{public static class Class1{private static PaletteSet pset;[CommandMethod("xx")]public static void XX(){ Line line = new Line(Point3d .Origin,new Point3d(100,100,0));object line2 = line.Clone();if (line2 is Line linecopy){linecopy.ReverseCurve();Z.db.AddEntityToModeSpace(linecopy);};Z.db.AddEntityToModeSpace(line);Z.Zoom();}}
}

 

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com