@GORDONMABIYA wrote:
"But we copy the item # from the BOM to the authority property, done with I-logic so would be easy enough to set a property."
Hi Mario428
How do you copy with iLogic. Can you please provide the steps.
I am bit of a novice when it comes to Inventor programming.
Hello Gordon
See the I-logic below, was incorrect in my first post
Item is copied to the Engineer property but easy enough to change it.
Since we use frame generator the property Item Qty is copied to authority
There is also a "NUM_OF_ASSYS" property added to your parameters, we use this if there is multiple assemblies, multiplies item qty so authority property reflects how many parts required to do all the assemblies
Hope it helps
doc = ThisDoc.Document
Dim oAssyDef As AssemblyComponentDefinition = doc.ComponentDefinition
Dim oBOM As BOM = oAssyDef.BOM
oBOM.PartsOnlyViewEnabled = True
Dim oBOMView As BOMView = oBOM.BOMViews.Item("Parts Only")
Dim oBOMRow As BOMRow
For Each oBOMRow In oBOMView.BOMRows
'Set a reference to the primary ComponentDefinition of the row
Dim oCompDef As ComponentDefinition
oCompDef = oBOMRow.ComponentDefinitions.Item(1)
Dim CompFullDocumentName As String = oCompDef.Document.FullDocumentName
Dim CompFileNameOnly As String
Dim index As Integer = CompFullDocumentName.lastindexof("\")
CompFileNameOnly = CompFullDocumentName.substring(index+1)
Dim Itm As Integer
Itm = oBOMRow.ItemNumber ()
If iProperties.Value(CompFileNameOnly, "Project", "Engineer") = "" Then
iProperties.Value(CompFileNameOnly, "Project", "Engineer") = Itm
End If
If iProperties.Value(CompFileNameOnly, "Project", "Engineer") <> Itm Then
iProperties.Value(CompFileNameOnly, "Project", "Engineer") = Itm
End If
Dim Qty As Integer
Qty = oBOMRow.ItemQuantity
If iProperties.Value(CompFileNameOnly, "Project", "Authority") = "" Then
iProperties.Value(CompFileNameOnly, "Project", "Authority") = NUM_OF_ASSYS*Qty
End If
If iProperties.Value(CompFileNameOnly, "Project", "Authority") <> NUM_OF_ASSYS*Qty Then
iProperties.Value(CompFileNameOnly, "Project", "Authority") = NUM_OF_ASSYS*Qty
End If
Next