- 积分
- 258
- 明经币
- 个
- 注册时间
- 2003-9-28
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
发表于 2003-12-2 09:03:00
|
显示全部楼层
BOOL GetPolylinePoint(AcDbObject * pDbO, AcGePoint3dArray &gePoi3dA, long &lNum)
{
AcDbObjectId DbOId;
AcGePoint3d gePoi3d;
lNum=0;
// 釋放數組gePoi3dA
if (gePoi3dA.logicalLength() > 0) {
gePoi3dA.removeSubArray(0, gePoi3dA.logicalLength()-1);
}
if (pDbO->isKindOf(AcDbPolyline::desc())) {
// 處理Polyline
lNum = ((AcDbPolyline *)pDbO)->numVerts();
for(long i=0;i<lNum;i++) {
((AcDbPolyline *)pDbO)->getPointAt(i , gePoi3d);
gePoi3dA.append(gePoi3d);
}
}else if (pDbO->isKindOf(AcDb2dPolyline::desc())) {
// 處理2dPolyline
AcDb2dVertex * pDb2dV;
AcDbObjectIterator * pDbOIt;
pDbOIt = ((AcDb2dPolyline *)pDbO)->vertexIterator();
for(pDbOIt->start();!pDbOIt->done(); pDbOIt->step()) {
DbOId = pDbOIt->objectId();
((AcDb2dPolyline *)pDbO)->openVertex(pDb2dV, DbOId, AcDb::kForRead);
gePoi3d = pDb2dV->position();
pDb2dV->close();
gePoi3dA.append(gePoi3d);
}
delete pDbOIt;
}else if (pDbO->isKindOf(AcDb3dPolyline::desc())) {
// 處理3dPolyline
AcDb3dPolylineVertex * pDb3dPV;
AcDbObjectIterator * pDbOIt;
pDbOIt = ((AcDb3dPolyline *)pDbO)->vertexIterator();
for(pDbOIt->start();!pDbOIt->done(); pDbOIt->step()) {
DbOId = pDbOIt->objectId();
((AcDb3dPolyline *)pDbO)->openVertex(pDb3dPV, DbOId, AcDb::kForRead);
gePoi3d = pDb3dPV->position();
pDb3dPV->close();
gePoi3dA.append(gePoi3d);
}
delete pDbOIt;
}else{
return FALSE;
}
lNum = gePoi3dA.logicalLength();
return TRUE;
} |
评分
-
查看全部评分
|