iLogic to change number of feature pattern occurances
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am currently working on a part that will ultimately be produced in multiples on a slab. The slab length can be 9, 10, 11 or 12 feet long based on optimum material usage. I have created a multi-body part that has a variable length for the finished part. The finished part then gets laid out for production in slab form. For this, I am writing a rule to determine the number of occurrences on a rectangular feature pattern.
I have written the start of the rule, which seems to work only when I force the slab length input in the rule. Once I change the slab length to a variable condition, the rule does not run properly. I get no errors returned, but nothing happens. The code as I have it written now is this:
slabLength="9" 'Change slabLength from feet to mm roundIT=(Round((slabLength*304.8)/partLength)) iteration=roundIT 'Test to see if math worked properly MessageBox.Show(iteration & "", "Title") ' ***Rectangular Pattern7*** Feature.IsActive("Rectangular Pattern7") = True Parameter("d177") = iteration
When I run the rule as written above, it calculates the number of occurrences correctly (iteration), but even with a parameter.updateafterchange command in place, I still have to manually click the update button on the Manage tab to change the pattern occurrences to the correct number. When I set the slabLength variable as the subject of a conditional statement, the rule fails to work at all. Such as this:
If slabLength="9" Then 'Change slabLength from feet to mm roundIT=(Round((slabLength*304.8)/partLength)) iteration=roundIT 'Test to see if math worked properly MessageBox.Show(iteration & "", "Title") ' ***Rectangular Pattern7*** Feature.IsActive("Rectangular Pattern7") = True Parameter("d177") = iteration Parameter.UpdateAfterChange = True End If
I will ultimately be setting this rule to run only when the partLength variable is greater than 660mm, but I haven't had any luck in getting it to run in any state so far.