找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 382|回复: 0

[求助]:XDRX_API 中 wordDraw()函数的疑问

[复制链接]
发表于 2004-8-13 12:04:50 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

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

×
参见了老大提供的程序
应用原话“
下面的代码是XDRX_API里面关于拖动选择集部分的虚函数worldDraw(..)的实现,里面拖动BLOCK,考虑了属性等

代码:


                virtual Adesk::Boolean  worldDraw(AcGiWorldDraw * wd)
                {
                        wd->geometry().pushModelTransform(m_mat);
                        AcDbEntity* pE;
                        for (int i=0;iattributeIterator ();
                                                // if it allocated ok
                                                if (pAttributeIterator != NULL)
                                                {
                                                        AcDbObjectId   ObjId;
                                                        AcDbAttribute *pAttribute = NULL;         
                                                        // now loop through them
                                                        for (int count=0; !pAttributeIterator->done(); pAttributeIterator->step(), ++count)
                                                        {
                                                                // get the object id of the attribute
                                                                ObjId = pAttributeIterator->objectId();
                                                                // open the object so we can draw it
                                                                if (acdbOpenObject (pAttribute, ObjId, AcDb::kForRead) != Acad::eOk)
                                                                        continue;
                                                                // now draw it
                                                                wd->geometry().draw (pAttribute);
                                                                // now close the attribute
                                                                pAttribute->close();
                                                        }
                                                        // delete the iterator
                                                        delete pAttributeIterator;                                               
                                                       
                                                        // see if we have any attributes attached to this block
                                                        // if we have then to stop the attribute definitions being drawn
                                                        if (count)
                                                        {
                                                                AcDbVoidPtrArray entitySet;
                                                                // explode and get some temporary entities
                                                                Acad::ErrorStatus es = pBlockref->explode (entitySet);
                                                                // if it worked ok
                                                                if (es == Acad::eOk)
                                                                {
                                                                        // loop round getting the intersection points
                                                                        for (long i=0l; igeometry().draw (pNewEnt);
                                                                                }
                                                                               
                                                                                // delete the temporary entity
                                                                                delete pNewEnt;
                                                                        }
                                                                }
                                                        }
                                                        // no attributes - just draw
                                                        else
                                                        {
                                                                wd->geometry().draw(pE);
                                                        }
                                                }
                                                // failed attribute iterator - just draw it
                                                else
                                                {
                                                        wd->geometry().draw(pE);
                                                }
                                        }
                                        // not a block reference - just draw then
                                        else
                                        {
                                                wd->geometry().draw(pE);
                                        }
                                        pE->close();
                                }
                        }
                       
                        wd->geometry().popModelTransform();
                        return Adesk::kTrue;
                }



看不懂这句                        AcDbEntity* pE;
                        for (int i=0;iattributeIterator ();
for 循环中是不是打错什么了?
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|申请友链|Archiver|手机版|小黑屋|辽公网安备|晓东CAD家园 ( 辽ICP备15016793号 )

GMT+8, 2024-9-22 01:23 , Processed in 0.337748 second(s), 29 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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