AcDbBlockReference::geomExtentsBestFit Function
Acad::ErrorStatus geomExtentsBestFit( AcDbExtents& extents, const AcGeMatrix3d& parentXform = AcGeMatrix3d::kIdentity) const; extents | Output the WCS extents of the block reference | parentXform | Input the transformation to be applied to the block reference抯 geometry | When working in non-WCS coordinate systems, the extents returned from AcDbBlockReference::geomExtents() can be somewhat larger that the actual geometry because AcDbBlockReference::geomExtents() transforms the contained entities' precomputed extents by the block reference抯 transformation matrix rather than transforming the entities and computing a new box for the transformed entity set. This results in non-world aligned extent boxes for the entities. This is fast, but will provide an "exaggerated" enclosing extents box.
AcDbBlockReference::geomExtentsBestFit() avoids this problem by getting copies of all the entities in the referenced block table record, applying parentXform to them, and then calculating the extents on the resulting entity set. This is slower than the process used by AcDbBlockReference::geomExtents(), but will result in the tightest fitting AcDbExtents for the enclosed geometry.
This method works recursively for nested block references. When this method is called on the outermost block reference (the normal case for ARX applications), parentXform should be the identity matrix. For calls on nested block references, parentXform should be the cumulative transformation from the outermost block reference down to the block reference that is referencing the block table record that owns the block reference on which this method is being called.
This method uses the AcDbBlockReference::explode() method to get copies of the entities. Since the AcDbBlockReference::explode() does not currently support nonuniform transformations, if the block reference on which this method is called, or any nested block references have nonuniform transformations, then this method cannot succeed and will return Acad::eInvalidInput.
Returns Acad::eOk if successful.
帮助文件里面已经说的清楚了。
|