change the quantity of a virtual part in a assembly, VB.net

change the quantity of a virtual part in a assembly, VB.net

davidt162003
Advocate Advocate
138 Views
1 Reply
Message 1 of 2

change the quantity of a virtual part in a assembly, VB.net

davidt162003
Advocate
Advocate

I was trying to add a virtual bolt part onto my BOM which i was able to do however i couldn't change the quantity of the bolts in the bom.

Dim VirtualBoltMatrix = _App.TransientGeometry.CreateMatrix
Dim VirtualBolt = MyAssyDef.Occurrences.AddVirtual("Bolt", VirtualBoltMatrix)
For Each pBomRow As BOMRow In MyAssyDef.BOM.BOMViews(1).BOMRows
    Dim oCompDef = pBomRow.ComponentDefinitions(1)
    Dim PartName = oCompDef.PropertySets.Item("Design Tracking Properties").Item("Description")
    If PartName <> "Bolt" Then

    Else
        Dim pBoltQuantity As [Property] = oCompDef.PropertySets.Item("Design Tracking Properties").Item("Quantity")
        pBoltQuantity.Value = .Flange_NU
    End If
Next

 This is what i tried but i get a  error when looking for property set on the component definition i found 

HII
0 Likes
139 Views
1 Reply
Reply (1)
Message 2 of 2

A.Acheson
Mentor
Mentor

Hi @davidt162003 

Bom Qty is sourced from the BOMRow and not an iproperty. 

Dim Qty As String = pBomRow.TotalQuantity      

 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes