CATIGeometricalElement_var spGeoElem(CopySelectArrange);
if(spGeoElem==NULL_var)
{
cout<<"得到GeometricalElement失败!"<<endl;
return FALSE;
}
CATBody_var spBody = spGeoElem->GetBodyResult();
CATLISTP(CATCell) LISTCell;
int nCellType = 1; //取vertex是0, 取edge是1, 取face是2, 取volumn是3
spBody->GetAllCells(LISTCell, nCellType);
cout<<"列表LISTCell的几何体个数:"<<LISTCell.Size()<<endl;
CATIFeaturize_var spIFEdgeElem = NULL_var;
for( int index = 1; index <= LISTCell.Size(); index++ )
{
CATCell *pEdgeCell = LISTCell[index];
if(!pEdgeCell)
{
continue;
}
CATCell_var spEdgeCell = pEdgeCell;
if(!spEdgeCell)
{
continue;
};
CATIBRepAccess_var BRepEdge1 = CATBRepDecode(spEdgeCell,spGeoElem);
spIFEdgeElem = BRepEdge1;
cout<<index<<endl;
if (NULL_var == spIFEdgeElem)
{
cout<<"未识别出一条边!"<<endl;
return FALSE;
}
CATISpecObject_var spEdgeElem = NULL_var;
spEdgeElem = spIFEdgeElem->FeaturizeF(MfDuplicateFeature | MfPermanentBody | MfSelectingFeatureSupport | MfFunctionalFeaturization);
if (NULL_var == spEdgeElem)
{
cout<<"特征化失败!"<<endl;
return FALSE;
}
CATISpecObject_var spSpecTmp = spEdgeElem; CATISpecObject_var ispInputParent = spGsmTool;
InsertInProceduralView(spSpecTmp,ispInputParent);
}
这样怎么添加不到结构树上 |