- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
iLogic How to use Variables between Subs, How to calculate 'left over' QTY while processing an Assembly.
I would like to ask some questions about programming in iLogic.
If I assign a variable that I want to pass to a function or sub, can I keep the variable name the same? For example 'oDoc as Document' I want to pick up in different subs to do something with it.
Always a different name or not?
What exactly is the difference between a Public Function and a Function without Public?
I'm working on a rule/application that 'pulls apart' our entire project and puts it in our folder structure.
Finally, we end up with different welding compositions, whether or not based on Phantom or Normal assemblies, whether or not Under Class Approval, etc.
At the end of this process, it is the intention that the Parts that remain will be placed in a folder 'Other Parts', subdivided into Steel and Stainless Steel.
This in itself is going well.
I want to add the quantity of the part or assembly after the file name (step, pdf, dwg and jpg).
I mean for a part the required number with regard to the welding assemblies and of the welding assemblies the total number with regard to the main assembly.
In short, our supplier can easily see from the file name how many times he has to make something.
In itself it works fine to take the assemblies apart recursively and to get them in the desired folder.
I want to determine the numbers for the individual components using:
partQty = oCompDef.Occurrences.AllReferencedOccurrences(oDoc).Count
At the beginning of the rule I go through all the components to make lists of them for learning, entertainment and finally to determine the policy.
At the same time I put all components in a List from which the totals can be retrieved.
I am now looking for a smart way to subtract these totals when the components are processed in the different assemblies.
In other word, I wanna know what's left at the end of this process.
Can I do this through a List, do I have to use a Dictionary for it, or does iLogic have much smarter ways to do it?