ObjectARX
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

getGeomExtents with angle question?

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
D_D_K
458 Views, 2 Replies

getGeomExtents with angle question?

Hi,

I wanted to get the corner points of the entity with a given angle (boundingbox with angle in WCS). 

so i have set up ucs as below code however these points are still in ortho form:

 

AcdbEntity* ent...
//WCS
AcGePoint3d origin = PT0;
AcGeVector3d xDirection =polar(PT0,pi/6,1)-PT0;
AcGeVector3d yDirection =polar(PT0, pi/6 + pi/2, 1) - PT0;
AcGeVector3d zDirection =xDirection.crossProduct(yDirection);

AcGeMatrix3d matrix;
matrix.setCoordSystem(origin, xDirection, yDirection, zDirection);
acedSetCurrentUCS(matrix); //set to UCS
AcDbExtents extents;
ent->getGeomExtents(extents);
..
acedSetCurrentUCS(m); //WCS

 

How do I fix this code?

 

Thanks you!

2 REPLIES 2
Message 2 of 3
artc2
in reply to: D_D_K

getGeomExtents is supposed to always return extents parallel to the WCS axes.
The only way that I can think of to get what you want would be to temporarily transform the entity so that it is angled relative to the WCS axes so that the resulting extents that are parallel to the WCS axes are "angled" relative to the entity in the way that you want, get the extents, and then undo the transform on the entity to put it back to where it was. If you don't want to transform the original entity, you could make a copy, transform that, get its extents, and then delete the copy.
Message 3 of 3
D_D_K
in reply to: artc2

Thanks sir for the detailed instructions.

my problem has been resolved. 😍

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


Autodesk Design & Make Report