明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 942|回复: 2

[基础] C#里获取实体最小矩形的函数是哪个?

[复制链接]
发表于 2015-11-4 10:58 | 显示全部楼层 |阅读模式
C#里获取实体最小矩形的函数是哪个?就是获取实体的外部范围。
 楼主| 发表于 2015-11-4 11:01 | 显示全部楼层
相对于VBA里的GetBoundingBox。
 楼主| 发表于 2015-11-4 14:57 | 显示全部楼层
                Point3d extMinPt=ent.GeomExtents.MinPoint;
                Point3d extMaxPt = ent.GeomExtents.MaxPoint;
                Point2d extMin = new Point2d(extMinPt.X, extMinPt.Y);
                Point2d extMax = new Point2d(extMaxPt.X, extMaxPt.Y);
                Point2dCollection pt2dCollection=new Point2dCollection();
                pt2dCollection.Add(extMin);
                pt2dCollection.Add(extMax);
                Polyline poly=CreateEnt.Polyline(pt2dCollection, 0);
                CreateEnt.ToModelSpace(poly);
               
                用GeomExtents得到的最小和最大点如图所示。我醉了。。。
               
                                

本帖子中包含更多资源

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

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

本版积分规则

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

GMT+8, 2024-4-25 17:53 , Processed in 0.334696 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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