by Florentina Stirbu
Recently I had a support request where virtual parts that represent fixings need to be counted when each assembly component type comes with a known number of a specific fixing type.
As an example, the assembly below has two component types: TypeA and TypeB.
First, I’ve created a virtual part for each fixing type:
Then, parameters were added for the fixings count of each component type.
The iLogic code will get the QTY for each component type from the BOM, multiply that using the respective number of fixings and then override the BOM QTY for the virtual parts.
The above is written taking into consideration 2 fixing types (one for each component type). For different scenarios, the code will need to be adjusted accordingly.
If there is only one fixing type, you can get the code to override the QTY with the sum of the previously calculated values.
Both versions of the code are attached below.