Message 1 of 3
LxBxH Dimension auto update after Saving
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Dear all,
I need help, for LxBxH Dimension for partlist, auto update after Saving file.
currently i am using i logic code
i need to run code every time .
also using run rule in child part but some time it get miss, then required dimension not get update.
event trigger take lot time for saving
if i make something so my dimension update after save , i will save lot of time
but i dont idea how to make it
My i logic Code
' Get the current Part document. Dim partDoc As PartDocument = ThisDoc.Document
' 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
' Convert lengths to document's length units.
Dim uom As UnitsOfMeasure = partDoc.UnitsOfMeasure
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
Dim minLength As Double = lengths(0)
Dim midLength As Double = lengths(1)
Dim maxLength As Double = lengths(2)
'Save into iProperties.Value("Project", "Description
iProperties.Value("Project", "Description") = midLength.ToString("#.###")&"x"& minLength.ToString("#.###")&"x"& maxLength.ToString("#.###")
InventorVb.DocumentUpdate()
'i need it run this code automatically without i logic
please see screen shot
Thanks in advance
Please help