明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 2974|回复: 4

[基础] Polyline怎么取得其顶点的集合?

[复制链接]
发表于 2011-5-18 17:47 | 显示全部楼层 |阅读模式
本帖最后由 asd106 于 2011-5-18 17:55 编辑

Polyline.AddVertexAt这个方法可以加点,
那么,Polyline怎么取得其顶点的集合?

发表于 2011-5-18 22:59 | 显示全部楼层
          for (int i = 0; i < pline.NumberOfVertices; i++)
          {
            Point3d tP = pline.GetPoint3dAt(i) ;

另:需注意封闭和不封闭 Polyline 的NumberOfVertices数量的不同
 楼主| 发表于 2011-5-19 08:22 | 显示全部楼层
那封闭和不封闭能判断么?
发表于 2011-5-19 08:41 | 显示全部楼层
1,学会自己去看ObjectARX的参考文件
2,学会自己去看Visual Studio的对象浏览器
3,Closed
发表于 2011-5-24 10:03 | 显示全部楼层
Point3dCollection pt3ds=new Point3dCollection ();
Point3d Pt3=new Point3d ();
for (int i = 0; i < pline.NumberOfVertices; i++)
          {
            Pt3 = pline.GetPoint3dAt(i) ;
            pt3ds.Add(Pt3);
           }
Point2dCollection pt2ds=new Point2dCollection ();
Point2d Pt2 =new Point2d();
   for (int i = 0; i < pline.NumberOfVertices; i++)
          {
            Pt2 = pline.GetPoint2dAt(i) ;
            pt2ds.Add(Pt2);
           }
其中pt3ds,pt2ds就是点集喽,一个是二维的一个是三维滴


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

本版积分规则

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

GMT+8, 2024-5-17 14:07 , Processed in 0.151246 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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