A while back, I was visiting a customer with an interesting design challenge. They happened to be a specialty fastener manufacturer, and a big part of their design work includes the development of the part geometry (and associated tooling dies) as it goes through the forging operations to produce the final part. Just imagine that every change of the component from one forming operation to the next must maintain the same part volume. If the bolt’s head is shortened, then it must also increase in diameter to maintain the same volume. When making a bunch of design changes, you can only imagine how many attempts must be made at changing parameters to get the volume correct.
Since this customer is using Autodesk Inventor, there is an automation environment called iLogic that can be used to solve this challenge. With a bit of minor customization in iLogic, an iterative process can be developed to automatically adjust one parameter when another changes.
The following code could be adapted in iLogic to satisfy many similar situations:
Parameter.UpdateAfterChange = False Dim CurrentVolume As Double Dim VolumeDelta As Double Dim OldVolume As Double Dim PercentChange As Double 'reset the percent to a high value so the routine runs PercentChange = 10 If HeadDepthChange <> 0 Then OldVolume = CDbl(iProperties.Volume) HeadDepth = HeadDepth - HeadDepthChange 'iterate until volume nearly matches While Abs(PercentChange) > .00000000001 RuleParametersOutput() InventorVb.DocumentUpdate() ThisApplication.ActiveView.Update() CurrentVolume = CDbl(iProperties.Volume) VolumeDelta = OldVolume-CurrentVolume Percentchange = VolumeDelta / OldVolume HeadDia = HeadDia + HeadDia*PercentChange/2 End While CurrentVolume = CDbl(iProperties.Volume) VolumeDelta = OldVolume-CurrentVolume Percentchange = VolumeDelta / OldVolume ' MessageBox.Show(PercentChange , "Final Percent of Change") MessageBox.Show("Original Volume = " & OldVolume & " New Volume = " & CurrentVolume & " Volume Difference = " & VolumeDelta, "Volume Change") HeadDepthChange = 0 End If