Message 1 of 9

Not applicable
05-23-2018
07:15 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am looking for a way to change my cut length code.
Sometimes the Max length is already in the material description
example: a 2.00" x 3.00" Rectangular tube is cut at 1.25": The Max Length comes out as 3.00" when it should be 1.25"
I need to check if the Measure.ExtentsLength, Measure.ExtentsWidth, Measure.ExtentsHeight..... is already in the material description then use the one that is not in the description.
The material description is stored in iProperties.Value("Project", "Stock Number")
Here is the code I am using, any help is greatly appreciated.
oDoc = ThisDoc.Document Dim MyArrayList As New ArrayList 'get measurements My_x = Measure.ExtentsLength My_y = Measure.ExtentsWidth My_z = Measure.ExtentsHeight 'Make longest value the Length, rounded to 4 places MaxLength = Round(MaxOfMany(My_x, My_y, My_z), 4) Dim propertyName1 As String = "CALCLength" 'define custom prpoerty collection oCustomPropertySet = ThisDoc.Document.PropertySets.Item("Inventor User Defined Properties") Try 'set property value oProp = oCustomPropertySet.Item(propertyName1) Catch ' Assume error means not found so create it oCustomPropertySet.Add("", propertyName1) End Try 'set custom property value iProperties.Value("Custom", "CALCLength") = MaxLength
Solved! Go to Solution.