I get an exception on IEntity_DG.GetBoundingBox() for a mesh entity. Here is my code:
Code: Select all
IModel_DGPtr iModel = m_kernCAD.GetModel();
int n = 0;
iModel->GetEntityCount(&n);
if (n < 1) return;
IEntity_DGPtr iEntity;
iModel->GetEntityAt(0, &iEntity);
Box_DG box;
iEntity->GetBoundingBox(VARIANT_FALSE, &box);
double size = (box.range[0].max - box.range[0].min)*(box.range[1].max - box.range[1].min)*(box.range[2].max - box.range[2].min);