Message 1 of 5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Gang...
I have created some iLogic which creates a parameter call Weld_Sum_Length if it doesn't exist, and then sums all the weld lengths into one value.
All works fine with Fillet welds, but as soon as I add a Groove weld into the mix it causes the iLogic to bug out.
The Bead Report calculates it, but the iLogic doesn't.
Here's the code and the error is attached....
'This has been added to Weld iLogic "Set Weldment View Reps(4) ' Creates parameter if "Weld_Length_Sum" doesn't exist oMyParameter = ThisApplication.ActiveDocument.ComponentDefinition.Parameters.UserParameters Try 'Change value of param Parameter("Weld_Length_Sum") = 0 Catch 'Create Param as it doesn't exist oParameter=oMyParameter.AddByValue("Weld_Length_Sum", 0, kInchLengthUnits) End Try Dim oDoc As AssemblyDocument oDoc = ThisDoc.Document Dim oComdef As WeldmentComponentDefinition oComdef = oDoc.ComponentDefinition 'Parameter("Weld_Length_Sum") = 0 Dim oWeldBead As WeldBead Dim oWeld As Weld For Each oWeld In oComdef.Welds If oWeld.Type = ObjectTypeEnum.kWeldBeadObject Then oWeldBead = oWeld Logger.Info("some info about the stuff that just happened...") 'Logger.Info(oWeldBead.BeadLength) 'MessageBox.Show((oWeldBead.BeadLength), "weld") Parameter("Weld_Length_Sum") = Parameter("Weld_Length_Sum") + (oWeldBead.BeadLength) End If Next Parameter("Weld_Length_Sum") = Round((Parameter("Weld_Length_Sum") / 2.54), 1) iProperties.Value("Custom", "Weld_Length") = Parameter("Weld_Length_Sum") 'MessageBox.Show(Parameter("Weld_Length_Sum"), "Total Length of All Welds") MessageBox.Show(iProperties.Value("Custom", "Weld_Length"), "Custom iProp: Total Length of All Welds")
Thank you in advance 🙂
Steve Hilvers
Inventor Certified User / Vault Professional Influencer
Inventor Certified User / Vault Professional Influencer
Solved! Go to Solution.