Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Use VBA to Add Qty Req'd to Custom Properties for Components from the ****'y?

24 REPLIES 24
SOLVED
Reply
Message 1 of 25
tdswanson
2305 Views, 24 Replies

Use VBA to Add Qty Req'd to Custom Properties for Components from the ****'y?

Hello:

 

I'd like to create a macro that I can run from within an assembly that will loop through each BOM item and add the quantity req'd to a custom property within the component.  I'm very familiar with VBA from Office, but I'm new to it with respect to Inventor so I'm pretty fuzzy with object titles and options.  Can someone assist with the coding?

 

Here's an outline of what I'd like to do:

 

Execute Macro from within Assembly file

 

For Each BOM Item to # of BOM Items

 

  If Vendor = "Make" then

    Set Component Custom Property "Qty_Reqd" = Total Qty from BOM

  Endif

 

Next BOM Item

 


Can someone help and/or Is there an easier way?

 

Thanks!!

24 REPLIES 24
Message 21 of 25
MegaJerk
in reply to: Nsteel

Do you mean -  have it go through the component parts of the top level assembly without going through any of the sub-assemblies or their component parts? 




If my solution worked or helped you out, please don't forget to hit the kudos button 🙂
iLogicCode Injector: goo.gl/uTT1IB

GitHub
Message 22 of 25
Nsteel
in reply to: MegaJerk

moreso that if the top level assembly contains multiple instances of sub-assemblies "A" & "B" and parts "C" & "D"

it would only count these and not the items within "A" & "B".

 

Thanks.

 

Message 23 of 25
GosponZ
in reply to: Greatwhitenorth

Message 24 of 25
Nsteel
in reply to: GosponZ

Just what I was looking for.

Thanks a lot!!!

 

Message 25 of 25
GosponZ
in reply to: Nsteel

I'm glad this share help. Smiley Wink

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report