Message 1 of 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am looking to read the total quantity value of each individual part present in an assembly from the BOM and add it as a custom property to that part. I am having trouble editing the STD items which is in the library or the content center. So i need to check that particular item and skip those items if the ISMODIFIABLE property if false. how can i add that condition to the code?? here is my current code
Dim result As DialogResult = MessageBox.Show("Override / Update Qty value of all Dependant Parts in Assy??" & vbCrLf & vbCrLf & "Please Confirm", "Quantity Update Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2)
If result = DialogResult.Yes Then
Try
For Each invBomRow In invPartOnlyView.BOMRows
invPart = invBomRow.ComponentDefinitions.Item(1).Document
***** I am having problem adding this here.******
If invPart.IsModifiable = False Then Next
*************************************************
If invPart.ComponentDefinition.BOMStructure = BOMStructureEnum.kNormalBOMStructure Then
invPartQty = invBomRow.TotalQuantity.ToString
' Get the user defined (custom) property set.
invUDPropSet = invPart.PropertySets.Item("Inventor User Defined Properties")
Try
' Attempt to get an existing custom property named "Qty".
invQtyProp = invUDPropSet.Item("Qty")
invQtyProp.Value = invPartQty
Catch ex As Exception
Call invUDPropSet.Add(invPartQty, "Qty")
End Try
End If
Next
Catch ex As Exception
MsgBox(ex.Message)
End Try
End If
Solved! Go to Solution.