- 积分
- 26936
- 明经币
- 个
- 注册时间
- 2007-4-24
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
发表于 2014-12-24 00:19:03
|
显示全部楼层
ARX好像是这样写,好像有点问题- acDocManager->lockDocument(acDocManager->curDocument());
- ads_name ss;
- struct resbuf *rb;
- rb = acutBuildList(RTDXF0, _T("INSERT"), 2, _T("GC200"), RTNONE);
- int rt = acedSSGet(NULL, NULL, NULL, rb, ss);
- if (rt != RTNORM)
- {
- acutRelRb(rb);
- acedSSFree(ss);
- return;
- }
- acutRelRb(rb);
- long len;
- acedSSLength(ss, &len);
- for (int i = 0; i < len; i++)
- {
- ads_name ent, ssName, nextName;
- acedSSName(ss, i, ssName);
- acdbEntNext(ssName, nextName);
- AcDbObjectId entId = AcDbObjectId::kNull;
- AcDbEntity *pEnt = NULL;
- acdbGetObjectId(entId, nextName);
- if (acdbOpenObject(pEnt, entId, AcDb::kForWrite) == eOk)
- {
- if (pEnt->isKindOf(AcDbText::desc()))
- {
- AcDbText *pText = AcDbText::cast(pEnt);
- AcGePoint3d posPt = pText->position();
- double ptX, ptY, boxX, boxY;
- ptX = posPt.x;
- ptY = posPt.y;
- AcDbExtents Ext;
- pText->getGeomExtents(Ext);
- AcGePoint3d minPt, maxPt;
- minPt = Ext.minPoint();
- maxPt = Ext.maxPoint();
- boxX = maxPt.x;
- boxY = maxPt.y;
- ads_point pt1, pt2, pt3, pt4;
- acutPolar(asDblArray(posPt), 1.25 * PI, 0.1414, pt1);
- acutPolar(pt1, 0.0, boxX + 0.2, pt2);
- acutPolar(pt2, 0.5 * PI, boxY + 0.2, pt3);
- acutPolar(pt1, 0.5 * PI, boxY + 0.2, pt4);
- acedCommand(RTSTR, TEXT("wipeout"),
- RT3DPOINT, pt1,
- RT3DPOINT, pt2,
- RT3DPOINT, pt3,
- RT3DPOINT, pt4,
- RTSTR, _T("C"),
- RTNONE);
- acedCommand(RTSTR, TEXT("draworder"),
- RTENAME, ssName,
- RTSTR, TEXT(""),
- RTSTR, _T("F"),
- RTNONE);
- pText->close();
- }
- pEnt->close();
- }
- }
- acedSSFree(ss);
- acDocManager->unlockDocument(acDocManager->curDocument());
复制代码 |
|