Dounding_Box - Dimension - Part List

Dounding_Box - Dimension - Part List

ivanildo.b
Advocate Advocate
255 Views
3 Replies
Message 1 of 4

Dounding_Box - Dimension - Part List

ivanildo.b
Advocate
Advocate

 

What should

03.001.00005-1.png03.001.00005-2.png03.001.00005-3.png

I do for the bounding_Box to provide the correct measurements?

0 Likes
256 Views
3 Replies
Replies (3)
Message 2 of 4

tyler.warner
Advocate
Advocate

@ivanildo.b I'm not sure exactly what you are asking but this forum has good info on this topic.

 

If this solved your problem or answered your question, please click ACCEPT SOLUTION.
If this helped you, please click LIKE.
0 Likes
Message 3 of 4

ivanildo.b
Advocate
Advocate
Plate is tilted.
I cannot rotate the part.
When I use Bounding_Box, it collects the dimensions of the angled part
I need the rule to give correct dimensions.
03.001.00005-5.pngYou have to change the rule.
I don't know how to change the rule to make the correct measurements. Thanks.
0 Likes
Message 4 of 4

tyler.warner
Advocate
Advocate

@ivanildo.b  It looks like this will do the trick for you. Reference the full discussion on this topic here.

 

 

' Get the current Part document.
Dim partDoc As PartDocument = ThisDoc.Document

' Convert lengths to document's length units.
Dim uom As UnitsOfMeasure = partDoc.UnitsOfMeasure

' Get surface body to measure (assume it's the first body).
Dim body1 As SurfaceBody = partDoc.ComponentDefinition.SurfaceBodies.Item(1)

' Get the oriented mininum range box of the body.
' NOTE: "OrientedMinimumRangeBox" was added in Inventor 2020.3/2021.
Dim minBox As OrientedBox = body1.OrientedMinimumRangeBox

' Get length of each side of mininum range box.
Dim dir1 As Double = minBox.DirectionOne.Length
Dim dir2 As Double = minBox.DirectionTwo.Length
Dim dir3 As Double = minBox.DirectionThree.Length

dir1 = uom.ConvertUnits(dir1, "cm", uom.LengthUnits)
dir2 = uom.ConvertUnits(dir2, "cm", uom.LengthUnits)
dir3 = uom.ConvertUnits(dir3, "cm", uom.LengthUnits)

' Sort lengths from smallest to largest.
Dim lengths As New List(Of Double) From {dir1, dir2, dir3 }
lengths.Sort

Bounding_Box_Y = lengths(0)
Bounding_Box_X = lengths(1)
Bounding_Box_Z = lengths(2)

 

 

If this solved your problem or answered your question, please click ACCEPT SOLUTION.
If this helped you, please click LIKE.
0 Likes