Set a value in "QTY" Bomlist

Set a value in "QTY" Bomlist

gma
Advocate Advocate
502 Views
4 Replies
Message 1 of 5

Set a value in "QTY" Bomlist

gma
Advocate
Advocate

Hi,

 

I have this Ilogic code to find "BandL in subassembly''s in my assembly :

Dim total As Double = 0
Dim adoc As AssemblyDocument = ThisDoc.Document

For Each occ As ComponentOccurrence In adoc.ComponentDefinition.Occurrences
        Dim val As Double
        Try
               val = Parameter(occ.Name, "BandL")
               total = total + val 
        Catch
        End Try
Next occ

MessageBox.Show("Total length: " & total)

I need to set the "Total" in to a "Part" QTY in my assembly bomlist.

The filename of the part is different, it depense of witch type i need. But the part filename contains S1100 or S2400 and it is a content center file

How do I do that?

image.png

Regards

GM  

0 Likes
503 Views
4 Replies
Replies (4)
Message 2 of 5

JelteDeJong
Mentor
Mentor

You could set "Base Quantity" in your parts to the parameter "BandL"  (Tools -> Document Settings)

setBaseQuantity.png

then inventor will automaticaly set the total value in the "QTY" column.

qty.png

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

0 Likes
Message 3 of 5

gma
Advocate
Advocate

"BandL" comes not from a part. It comes from a rule(parameter) in a subassembly.

I Count alle the "BandL" manuel in the subassemblys and set the total value in the bomlist in my top assembly.

I need a rule for that.

0 Likes
Message 4 of 5

JelteDeJong
Mentor
Mentor

A part or (sub)assembly is not different. Also the "Base Quantity" in a (sub)assmbly can be set to a parameter "BandL"

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

0 Likes
Message 5 of 5

bshbsh
Collaborator
Collaborator

@gma wrote:

"BandL" comes not from a part. It comes from a rule(parameter) in a subassembly.

I Count alle the "BandL" manuel in the subassemblys and set the total value in the bomlist in my top assembly.

I need a rule for that.


and why do you do that? why don't you use the merge function in the bom?

0 Likes