iLogic rule to add calculated column to part list / BOM on drawing.

iLogic rule to add calculated column to part list / BOM on drawing.

Anonymous
Not applicable
1,653 Views
2 Replies
Message 1 of 3

iLogic rule to add calculated column to part list / BOM on drawing.

Anonymous
Not applicable

Hello everyone,

I have been struggling with this issue for a while now.

 

I’m creating drawings from STEP assemblies, I need to have Qty shown on all the component drawings.

As well as on the assembly drawing.

 Furthermore, I need to be able to multiply the Qty. to have a "Total Qty."

 

Example:                    BOM Qty.            Total Qty.

assembly "Table"            1                         4

part 1  "Table plate"       1                          4 

part 2 "Table leg"           4                         16

 

For now I have the Total Qty, in a Custom iProperty in all the drawing files, meaning I have that Total Qty. on the part drawings. 

Also in the assembly drawing file, I have a iProperty containing the value "4".

 My head egg, is to create a column in the part list, of the assembly drawing, where the iProperty value of the same file, is multiplied with the BOM Qty.

 

See ilustration.

 

Can someone please help, thanks a lot !

 

BR.

Ole Skov

 

 

 

0 Likes
Accepted solutions (1)
1,654 Views
2 Replies
Replies (2)
Message 2 of 3

rhasell
Advisor
Advisor

Hi

Try this.

https://forums.autodesk.com/t5/inventor-forum/part-assembly-quantities/m-p/4343717/highlight/true#M4... 

 

In a nutshell, you need to two new columns in your Part list. One becoming a multiplier.

 

Please note, in my example, one of my column headings were censored due to possible inappropriate language, so please check the screen dumps to get the column heading name.

 

 

Reg
2026.1
0 Likes
Message 3 of 3

Anonymous
Not applicable
Accepted solution

Hey rhasell,
I did find a solution - i could not use your solution "as is".

 

Fot the purpose of other users, here is what I did.

 

One thing that I found, that took me some time to figure out, the name of the BOM collumn in the iLogic code, has to be the "Heading" Not the original "Property"

 

 

The amount of assemblies, that the BOM will multiply with, is in the Custom "GA_Qty"

 

Here is my code - I have set a trigger to run the rule, before every save.

(see 3 attached pictures).

Also my iLogic code is attached as a txt file

 

Code below:

XXXXXXXXXXXXXXXXXXX


Dim oDrawDoc As DrawingDocument
oDrawDoc = ThisApplication.ActiveDocument
Dim oPartList As PartsList

 


'---------------------
'define custom property collection
oCustomPropertySet = ThisDoc.Document.PropertySets.Item("Inventor User Defined Properties")
Try
'set property value
oProp = oCustomPropertySet.Item("ASSQTY")
Catch
' Assume error means not found so create it
oCustomPropertySet.Add("", "ASSQTY")
End Try
'-----------------------

'If oPartList.PartsListRows.Count > "0"

Try


' Set a reference to the first parts list on the active sheet.
oPartList = oDrawDoc.ActiveSheet.PartsLists.Item(1)
'oASSQTY = InputBox("Enter Quantity of Assemblies Required", "iLogic",iProperties.Value("Custom", "ASSQTY") )

oASSQTY = iProperties.Value("Custom", "Ga_Qty")

iProperties.Value("Custom", "ASSQTY") = oASSQTY
' Iterate through the contents of the parts list.
Dim i As Long
For i = 1 To oPartList.PartsListRows.Count
oCell = oPartList.PartsListRows.Item(i).Item("Antal sæt.")
oCell.Value = iProperties.Value("Custom", "ASSQTY")
Next
'MessageBox.Show("All Done", "BOM QTY")

Catch
End Try