08-21-2021
06:20 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
08-21-2021
06:20 AM
I think the best way to do this is by adding 2 dummy parameters. (InnerDiameter and WallThickness) A dummy parameter for InnerDiameter is maybe not what you expect. But you need it to see if the InnerDiameter or the WallThickness has been changed. As an example, I used a tube. In the screencast below you will see all parameters that i used.
And this is the iLogic code to make it work:
Dim wt As Double = WallThickness Dim id As Double = InnerDiameter Dim idr As Double = Parameter("InnerDiameterReal") Dim odr As Double = Parameter("OuterDiameterReal") If (DoubleUtil.DoublesAreEqual(id, idr)) Then ' wall thickness has been changed Parameter("InnerDiameterReal") = odr - 2 * wt Parameter("InnerDiameter") = odr - 2*wt Parameter("WallThickness") = wt Else ' inner diameter has been changed Parameter("WallThickness") = (odr - id)/2 Parameter("InnerDiameterReal") = id End If
Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
Blog: hjalte.nl - github.com