AcDbFullSubentPath problem with Exploded subentities of AcDbBlockReference

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am currently using explode to place AcDbBlockReference into the same coordinate space as modelspace and then using a AcBrMesh2dControl to extract meshes. However, this is failing for subentities of a AcDbBlockReference. I believe it is because they have not been inserted into modelspace and thus do not have a valid AcDbFullSubentPath . I would rather not open this drawing for write and insert them into modelspace. If there anyway to construct a valid AcDbFullSubentPath for entities that are held in a AcDbVoidPtrArray. I am also thinking that I may need to iterate over the entities in the block table record and use the block reference transform. I am looking for a good example of this.
I get an error when I do the following:
elementShape = AcBr::kAllTriangles;
AcBrMesh2dControl meshCtrl;
returnValue = meshCtrl.setMinSubdivisionsInU(minSubdivisionsInU);
returnValue = meshCtrl.setMinSubdivisionsInV(minSubdivisionsInV);
returnValue = meshCtrl.setMaxSubdivisions(maxSubdivisions);
returnValue = meshCtrl.setMaxNodeSpacing(maxNodeSpacing);
returnValue = meshCtrl.setAngTol(angTol);
returnValue = meshCtrl.setDistTol(distTol);
returnValue = meshCtrl.setMaxAspectRatio(maxAspectRatio);
returnValue = meshCtrl.setElementShape(elementShape);
AcDbFullSubentPath psubpath;
psubpath.objectIds().append(pEnt->id()); // pEnt may either belong to modelspace or be an
// entity created by a block reference explode
AcBrEntity *lbrepEntity=NULL;
lbrepEntity = new AcBrBrep();
returnValue = lbrepEntity->set(psubpath)) // ERROR occurs here!
if (returnValue==eOk) {
returnValue = brepMesh.generate(meshFilter)
}