VBA: renumber bom items with zero increment

VBA: renumber bom items with zero increment

bionorica2015
Enthusiast Enthusiast
482 Views
5 Replies
Message 1 of 6

VBA: renumber bom items with zero increment

bionorica2015
Enthusiast
Enthusiast

Hello 

Can we renumber bom items with zero increment?

Bom items will be  with value =1 , others with value=2.....

0 Likes
483 Views
5 Replies
Replies (5)
Message 2 of 6

WCrihfield
Mentor
Mentor

Hi @bionorica2015.  Are you talking about overwriting the ItemNumber property of the BOMRow?  That value is Read/Write, but when you set the ItemNumber's value to something identical to another BOMRow ItemNumber's value, it will usually get highlighted (within the BOM dialog), because it is unusual and can cause problems.  Yes, it is possible to do, but generally not recommended.  How would the macro determine which rows to set to value of 1, and which rows to set to value of 2, and so on?

Also:  I assume you are familiar with the BOMView.Renumber method, but I also assume it will not work for your situation, right?

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 3 of 6

bionorica2015
Enthusiast
Enthusiast

I dont know any of this apis.

 

0 Likes
Message 4 of 6

WCrihfield
Mentor
Mentor

Can you capture images of your BOM before changes, then do the changes you want to do manually, then capture images of the BOM after the changes, and post them here, so we have a better idea of what needs to be changed, and how they need to be changed.  And hopefully some better detailed explanation about what changes you did.  Then maybe we can help you create VBA code to accomplish that task.  More information is better than less, if we are to find a way to automate it.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 5 of 6

bionorica2015
Enthusiast
Enthusiast

Before:

1.png

 After (what I want with help of macros 😞

2.png

0 Likes
Message 6 of 6

johnsonshiue
Community Manager
Community Manager

Hi! Sorry to reply to you late! I did not notice the private message. Here are two related old threads with iLogic rules.

 

https://forums.autodesk.com/t5/inventor-ilogic-and-vb-net-forum/ilogic-rule-to-change-the-bom-item-r...

 

https://forums.autodesk.com/t5/inventor-forum/bom-renumbering-and-part-list-sort-by-item-ilogic/td-p...

 

Please take a look.

Many thanks!



Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer
0 Likes