当前位置: 首页 > article >正文

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 integration

namespace 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 integration

namespace 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();
        }
       



    }
}

 


http://www.kler.cn/a/376641.html

相关文章:

  • 工厂电气及PLC【1章各种元件符号】
  • JDK的下载
  • MyBatis-Plus中AbstractJsonTypeHandler使用小结
  • SmartX 在新能源:支撑多家头部企业 MES 等核心系统稳定运行与 VMware 替换
  • Oasis 500M:开源的实时生成交互式视频内容的 AI 模型
  • 前端聊天室页面开发(赛博朋克科技风,内含源码)
  • Milvus - 基于角色的访问控制(RBAC)
  • transformers 框架使用详解,bert-base-chinese
  • 网页自动化测试和爬虫:Selenium库入门与进阶
  • C++教程(004):程序流程结构之选择结构
  • GB/T 28046.3-2011 道路车辆 电气及电子设备的环境条件和试验 第3部分:机械负荷(1)
  • 免费插件集-illustrator插件-Ai插件-闭合开放路径
  • 设计师赵霂萱:以卓越设计让 Harmony Garden Workspace 荣膺国际大奖
  • Java 集合一口气讲完!(上)||o(*°▽°*)o|Ю [有人吗?]
  • JAVA 基础-多态
  • 2024年第四届“网鼎杯”网络安全大赛-赛前模拟训练
  • DNS服务部署
  • Java网络通信
  • 从0开始学python-day17-数据结构2
  • layui 实现 城市联动
  • git cherry-pick用法详解
  • 顺序表和链表(一)
  • jmeter结合ansible分布式压测--准备工作
  • 深入了解嵌入式硬件设计
  • 视频智能分析平台LiteAIServer入侵检测算法平台部署行人入侵检测算法:智能安防的新利器
  • 钉钉内集成第三方免密登录(Vue+.Net)