09-21-2023
12:21 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
09-21-2023
12:21 AM
Hi @Ahmed.shawkyXTZHN . You can get the overall dimensions of the part using the OrientedMinimumRangeBox function. The results are in lines 11-13.
Dim oDoc As Document = ThisDoc.Document
If Not TypeOf oDoc Is PartDocument Then Exit Sub
Dim oPDoc As PartDocument = oDoc
Dim oBodies As SurfaceBodies = oPDoc.ComponentDefinition.SurfaceBodies
If oBodies.Count = 0 Then Exit Sub
Dim oBox As OrientedBox = oBodies(1).OrientedMinimumRangeBox
Dim lengths(3) As Double
Dim dSize As New List(Of Double)
dSize.AddRange({oBox.DirectionOne.Length, oBox.DirectionTwo.Length, oBox.DirectionThree.Length })
dSize.Sort()
lengths(0) = dSize(2) 'Max size box (cm)
lengths(1) = dSize(1) 'Mid size box (cm)
lengths(2) = dSize(0) 'Min size box (cm)
Andrii Humeniuk - CAD Coordinator, Autodesk Certified Instructor
LinkedIn | My free Inventor Addin | My Repositories
Did you find this reply helpful ? If so please use the Accept as Solution/Like.