码迷,mamicode.com
首页 > 编程语言 > 详细

CAD由实体句柄返回实体对象(com接口c#语言)

时间:2019-07-05 14:20:06      阅读:180      评论:0      收藏:0      [点我收藏+]

标签:database   详细   null   mtab   MTA   cin   dex   bsp   toe   

IMxDrawDatabase::HandleToObject

给一个实体的句柄,返回实体的对象,具体详细如下:

参数说明

[in] BSTR handle

实体的句柄

C#代码得到多线的端点,并成填充对象:

        private void TestFill(String sHandle)
        {
            MxDrawDatabase database = (MxDrawDatabase)axMxDrawX1.GetDatabase();
            MxDrawMcDbObject obj =  database.HandleToObject(sHandle);            
            if (obj == null)                
                return;            
            if (obj is MxDrawPolyline)
            {
                MxDrawPolyline poly = (MxDrawPolyline)obj;                
                int i = 0;               
                 for (; i < poly.NumVerts; i++)
                {
                        MxDrawPoint pt = (MxDrawPoint)poly.GetPointAt(i);                  
                          double dBulge = poly.GetBulgeAt(i);                 
                         if (i == 0)
                        axMxDrawX1.PathMoveTo(pt.x, pt.y);                   
                         else
                            axMxDrawX1.PathLineToEx(pt.x, pt.y, 0.0, 0.0, dBulge);
                }                
                if (i >= 3)
                {
                    axMxDrawX1.PathMakeClosed();
                    axMxDrawX1.DrawPathToHatch(1.0);
                }
            }
 
        }

 

CAD由实体句柄返回实体对象(com接口c#语言)

标签:database   详细   null   mtab   MTA   cin   dex   bsp   toe   

原文地址:https://www.cnblogs.com/yzy0224/p/11137946.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!