当前位置: 首页 > 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

相关文章:

  • 国产编辑器EverEdit - 扩展脚本:关闭所有未修改文档
  • Unity自定义编辑器:基于枚举类型动态显示属性
  • Ubuntu问题 -- 硬盘存储不够了, 如何挂载一个新的硬盘上去, 图文简单明了, 已操作成功
  • 【爬虫】单个网站链接爬取文献数据:标题、摘要、作者等信息
  • 在Jmeter中跨线程组传递变量(token)--设置全局变量
  • 【可实战】Bug的判定标准、分类、优先级、定位方法、提交Bug(包含常见面试题)
  • 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)