- UID
- 67882
- 积分
- 0
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2003-7-28
- 最后登录
- 1970-1-1
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
参见了老大提供的程序
应用原话“
下面的代码是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 循环中是不是打错什么了? |
|