AcDbFullSubentPath problem with Exploded subentities of AcDbBlockReference

AcDbFullSubentPath problem with Exploded subentities of AcDbBlockReference

Anonymous
Not applicable
676 Views
4 Replies
Message 1 of 5

AcDbFullSubentPath problem with Exploded subentities of AcDbBlockReference

Anonymous
Not applicable

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)

 

}

 

 

0 Likes
677 Views
4 Replies
Replies (4)
Message 2 of 5

owenwengerd
Advisor
Advisor

I don't understand why you have to use explode(), but why not then just put the exploded entities into a temporary database?

--
Owen Wengerd
ManuSoft
0 Likes
Message 3 of 5

Anonymous
Not applicable

I was only using Explode because it worked (transformed subentities and the entities retained all the properties and layering of original entities).  I can also continue to recurse into any block references that come out as subentities.

 

If I insert them into a temporary database, do I need to re-create all the layering that was in the original database?  I need to maintain the layering for properties.  I am doubting the creation of new layers happens automatically in the temporary database.  Sorry for my lack of experience, I have this one 3000 line ObjectARX C++ program that I created and maintain so I don't get a lot of exposure to doing things differently than my current implementation.  I recently added the ability to process solids (previously just processed wireframe entities) and ran into this meshing problem.

 

Also, I wish I could find a good example of iterating over the block table entities and using the block reference transform.  There is probably already one out there but I am not finding it.

 

Thanks

 

 

0 Likes
Message 4 of 5

owenwengerd
Advisor
Advisor
I think that if you used explode() "because it worked", maybe you should post instead with a description of the general problem you're trying to solve and ask for suggestions on better ways to solve it. At least explain why you can't just use the entities in the source database as they are. If you want to proceed with explode(), try adding the exploded entities to a temporary database as I suggested and see what happens.

@Anonymous wrote:

I was only using Explode because it worked (transformed subentities and the entities retained all the properties and layering of original entities).  I can also continue to recurse into any block references that come out as subentities.

 


 

--
Owen Wengerd
ManuSoft
0 Likes
Message 5 of 5

Anonymous
Not applicable

Thanks - I'll do that.  I can use the entities as is in the database opened for read.  I suspect there is no increase in processing time to transform the related block table entities as this already occurs during the explode.  I am hoping to find a good example of iterating over the entities and applying the transform. Also, I may try opening the database for write and just not save it.

0 Likes