- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
override bom quantity in subassembly
hi,
i want to override a certain rule in the BOM of a subassembly.
Dim AutoBOM As BOM = Subocc.Definition.BOM
Dim oBOMrow As BOMRow
For Each oBOMrow In AutoBOM.BOMViews.Item(1).BOMRows
If oBOMrow.ComponentDefinitions.Item(1).Document.Propertysets.Item("Design Tracking Properties").Item("Part Number").Expression = 483385 Then
oBOMrow.TotalQuantity = 5
Exit For
End If
Nextin this case i want to override the quantity of a part with partnumber 483385.
i thought when searching through BOM.Bomviews.item(1) "Unnamed" it would make the changes in the model data tab of the BOM.
However, when i excecute this rule it doesn't seem to override anything and the quantity stays at 1.
anyone know how to do this? ilogic functions like thisbom.overridequantity cannot be used in subassemblies.
kind regards,
Geert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi @GeertvanderHeide. The first detail that jumps out at me when reviewing your code is that the value of an iProperty's 'Expression' is always a String, and the value you are testing for is not quoted, which will fail.
Wesley Crihfield
(Not an Autodesk Employee)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
well, when the string is only a number it can compare to integers ,right?
code didn't bug out on it. the exit for also worked when using this.
edit:
okay, so i tested the code again, and somehow it does work now.. without any changes...
maybe inventor needs some motivation to work i guess..
thanks for the quick response anyway ![]()
kind regards,