admin 发表于 2024-5-4 18:44:29

临时反应器的简单应用

void MyDatabaseReactor::objectModified(const AcDbDatabase * dwg, const AcDbObject * dbObj)
{
if (dbObj->isKindOf(AcDbPolyline::desc()))
{
AcDbPolyline* pPoly=AcDbPolyline::cast(dbObj);
int vernum=pPoly->numVerts();
AcGePoint2d ptCenter;
AcGePoint2d pt;
pPoly->getPointAt(0,pt);
ptCenter.x=pt.x;
ptCenter.y=pt.y-100;
pPoly->upgradeOpen();
for (int i=0;i<vernum;i++)
{
pt.rotateBy(2*pi()/vernum,ptCenter);
pPoly->setPointAt(i,pt);
}
pPoly->setClosed(Adesk::kTrue);
pPoly->setColorIndex(1);
}
else if (dbObj->isKindOf(AcDbCircle::desc()))
{
AcDbCircle* pCir=AcDbCircle::cast(dbObj);
pCir->upgradeOpen();
pCir->setRadius(100);
pCir->setColorIndex(100);
}

}
页: [1]
查看完整版本: 临时反应器的简单应用