getting longest dimension of a part and reference to OBM

getting longest dimension of a part and reference to OBM

Anonymous
Not applicable
488 Views
2 Replies
Message 1 of 3

getting longest dimension of a part and reference to OBM

Anonymous
Not applicable

Hi I need help I'm with getting the longest measurement of a part but completely automated ussing ilogic. I want to get cut lengths any help would be appreciated 

0 Likes
489 Views
2 Replies
Replies (2)
Message 2 of 3

johnsonshiue
Community Manager
Community Manager

Hi! This should not be too hard. Here is a simple rule you can use. BTW, Length, Width, and Height are user parameters in a part.

 

Length=Measure.ExtentsLength
Width=Measure.ExtentsWidth
Height=Measure.ExtentsHeight

 

Many thanks!

 

 



Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer
Message 3 of 3

rhasell
Advisor
Advisor

Hi

 

Just to elaborate on Johnson Shiue comment. Here is an extract from my rule.

Play with it and adjust it to suit your needs. Also, as mentioned, you need to create the corresponding user parameters.

 

In my case, "HEIGHT,WIDTH,and THICK"

 

 

Dim oPart As PartDocument
oPart = ThisApplication.ActiveDocument
oDoc = ThisApplication.ActiveDocument

		'Turn off work features so they don't calculate
		oPart.ObjectVisibility.AllWorkFeatures = False
		InventorVb.DocumentUpdate()
Dim sizes As New List(Of Double)
sizes.Add(Measure.ExtentsLength)
sizes.Add(Measure.ExtentsWidth)
sizes.Add(Measure.ExtentsHeight)

sizes.Sort()
	Parameter("HEIGHT") = sizes(2)
	Parameter("WIDTH") = sizes(1)
	'Parameter("THICK") = sizes(0)
oPart.ObjectVisibility.AllWorkFeatures = True
iLogicVb.UpdateWhenDone = True
Reg
2026.1