CropBox bounding box

CropBox bounding box

atir5UTNF
Advocate Advocate
175 Views
1 Reply
Message 1 of 2

CropBox bounding box

atir5UTNF
Advocate
Advocate

I need to find the crop box bounding box.

atir5UTNF_2-1739697604494.png

 

 

In the API docs here:

Revit Api doc / View Class / CropBox 

atir5UTNF_3-1739697876321.png

 

 

It's mentioned that:

atir5UTNF_1-1739697224976.png

 

If I don't use the transform, the Min and Max values are incorrect. Should I use the transform, or is there a different way to convert the bounding box?

Is the transform ignored only for the case when I 'set' the CropBox property?

 

if (curView.CropBox.IsSet && curView.CropBoxActive)
{
   Transform cbTransform = curView.CropBox.Transform;
   XYZ cbMaxBefore = curView.CropBox.Max;
   XYZ cbMinBefore = curView.CropBox.Min;
   XYZ cbMaxAfter = cbTransform.OfPoint(cbMaxBefore);
   XYZ cbMinAfter = cbTransform.OfPoint(cbMinBefore);
}

 

 

The values:

cbMaxBefore = {(-254.965806570, 57.461380770, 3.180839895)}

cbMinBefore = {(-260.558644724, 50.482283586, -996.719160105)}

 

cbMaxAfter = {(-220.958274536, 51.273583119, 77.983989501)}

cbMinAfter = {(-226.551112691, 44.294485935, -921.916010499)}

 

The model is attached.

The view is : 7(1) - Callout 2

 

0 Likes
176 Views
1 Reply
Reply (1)
Message 2 of 2

rhanzlick
Advocate
Advocate

I personally struggled with this problem for a long time when automating Elevation creation. You are on the right track of an approach I would take, but consider also trying the Transform.Inverse as well.

0 Likes