明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 547|回复: 3

cad table 的镜像矩阵应该怎么写

[复制链接]
发表于 2024-2-16 00:45 来自手机 | 显示全部楼层 |阅读模式
Matrix3d.Mirroring 矩阵变换作用在cad 表格,表格到处乱跑,平移矩阵,对齐矩阵没有问题。
求助应该怎么处理表格的镜像。
发表于 2024-2-16 01:39 | 显示全部楼层
如果是我,我就重建这个表格,因为镜像翻转和其他都不太相同,其他只是旋转变换,而镜像之后还要看,需要表格和内容对齐,因此Y镜像就列宽度镜像,X镜像就....任意度就....
发表于 2024-2-18 11:24 | 显示全部楼层
发一张dwg看看  没听懂跑是啥意思
 楼主| 发表于 2024-2-21 09:49 | 显示全部楼层
本帖最后由 brainstorm 于 2024-2-21 09:53 编辑

可以通过Com方法镜像

  1. public static ObjectId MirrorByCom(
  2.         Entity ent,
  3.         Point3d pt1, Point3d pt2,
  4.         bool eraseSource)
  5. {

  6.     Editor ed =
  7.         Application.DocumentManager.MdiActiveDocument.Editor;
  8.     ObjectId rtn = ObjectId.Null;
  9.     try
  10.     {
  11.         dynamic dynObj = ent.AcadObject;
  12.         dynObj.Mirror(pt1.ToArray(), pt2.ToArray());
  13.         rtn = ed.EntLast();
  14.         if(eraseSource)
  15.         {
  16.             if (!ent.IsWriteEnabled)
  17.                 ent.UpgradeOpen();
  18.             ent.Erase(true);
  19.         }
  20.     }
  21.     catch (System.Exception)
  22.     {
  23.         return rtn;
  24.     }
  25.     return rtn;
  26. }
复制代码

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

x
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-5-9 04:49 , Processed in 0.232115 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表