Exporting Virtual Part Quantity yields only "1"

Exporting Virtual Part Quantity yields only "1"

Anonymous
Not applicable
655 Views
4 Replies
Message 1 of 5

Exporting Virtual Part Quantity yields only "1"

Anonymous
Not applicable

I have a problem exporting Virtual Part Over-ride quantities. I am using these codes in VBA:

 

Dim oBOMrow As BOMRow

For Each oBOMrow In oBOMview.BOMRows

     If ocompdef.Type = 100675072 Then 

      Quantity = oBOMrow.ItemQuantity
     End If

 

This "ItemQuantity" yields only "1". Also, I am attempting to use "0" value for items that we specify as "AR" or As Required.  I need to read the "0" then export and populate a spreadsheet cell value with "AR" for the virtual parts which have quantity of "0".

 

How do I first get the actual quantity of a virtual part that has been manually entered? As of now, I only get qty of "1" regardless of what is keyed in.

 

0 Likes
Accepted solutions (2)
656 Views
4 Replies
Replies (4)
Message 2 of 5

JamieVJohnson2
Collaborator
Collaborator

Capture.PNG

I believe your issue is the property you are accessing, "Item QTY" is a different property from "QTY".

 

Jamie Johnson : Owner / Sisu Lissom, LLC https://sisulissom.com/
0 Likes
Message 3 of 5

Anonymous
Not applicable

Jamie,

Thank you. However, using QTY gives me "Run time error 438, Object doesn't support this property or method".

 

Raj

0 Likes
Message 4 of 5

JamieVJohnson2
Collaborator
Collaborator
Accepted solution

It appears in the API the field for "TotalQuantity" is the name of the column on the screen "QTY", because there is also the field "TotalQuantityOverridden".  The user (me) can change the value from dynamic to static, so this allows the coder to know the user intervened.

 

 

Jamie Johnson : Owner / Sisu Lissom, LLC https://sisulissom.com/
Message 5 of 5

Anonymous
Not applicable
Accepted solution

Jamie,

You are absolutely correct! I replaced the ItemQTY with TotalQuantity() and it works like a charm!

 

Thank you very much, indeed. I will post the complete code tomorrow. My codes export BOM from an Inventor Assembly to an excel template and then open the exported file for review. Then when saved, it saves out to a dedicated output folder. Virtual parts with Qty other than O export with Qty as they are entered and Virtual parts with Qty of O, which are used for items like liquid sealants, paint etc export as "AR" which designates "As Required".

 

Raj

0 Likes