Get min point/max point of a bounding box from a solid

Hello everyone, I have a script as shown in the image below. Please explain to me why we have to add the Transform.Origin to get a bounding box’s min point/max point from a solid. Because if I get directly from an element, I don’t need to add the Origin.

If I don’t add the Origin, I will get the result like this which is not the min point/max point that I want.

Can’t say without a sample model and indication of what you are picking.

Try placing one wall in a brand new model from 0,0 to 10,10 and see what you get there.

I just want to get the min point/max point of the bounding box of a solid. That solid belongs to a wall that I selected. At first, I don’t add origin (I underline it in red) to the functions GetMinPoint, GetMaxPoint so I got the result in the second image (not the correct result). Then I found a code sample from the internet that I had to add origin to get the correct result. The point is when I retrieve the min point/max point directly from the element (it’s the second green rectangle mark in the first image), I don’t need to add the origin. So I just want to understand why is there a difference when getting min point/max point from solid and element.

Hard to say without knowing the context. Does this reproduce in a new model with one wall drawn from 0,0 to 10,0? Or only in a project?

Posting reproducible Python would also help - you’re asking someone to recreate a project like you have, then type your code from an image, and then try to identify the cause.

Best guess is that the bounding box is localized.

It’s just a Test project, and it looks like this. Nothing is special about it. I can’t upload it because its size is over 8MB.

And I’m sorry about the code in the image if it makes you uncomfortable. The code worked well so I think uploading an image will help everyone look more clearly because of the color in VSCode.
To make it not more complicated, I think I will accept that the bounding box is localized so I have to transform to get the correct.
Anyway, thanks a lot for your help.

1 Like