Edit Part number field in assembly and all children

Edit Part number field in assembly and all children

coreyparks
Advisor Advisor
443 Views
2 Replies
Message 1 of 3

Edit Part number field in assembly and all children

coreyparks
Advisor
Advisor

I am wondering if anyone has some code that will allow me to edit the part number iProperty in an daasmbly and indise of all its children.  I don't mean write over whats there but to be able to look at the part number, strip off the first 7 or so digits and then replace those digits with a number of my choosing.  I have modified some code to do this on the top level but I get lost when trying to traverse through the component occurences, I can't grab the child components part number and mofify each one indiviually.  I am not well versed in code but if I get something close I can usually make the changes required to get things to work. I don't care if its using VB or iLogic, either one will suffice, thanks.

Please mark this response "Accept as solution" if it answers your question.
-------------------------------------------------------------------------------------
Corey Parks
0 Likes
Accepted solutions (1)
444 Views
2 Replies
Replies (2)
Message 2 of 3

MechMachineMan
Advisor
Advisor

What functionality do you need over just opening the BOM, exposing the part number row, and manually changing it there?


--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
0 Likes
Message 3 of 3

coreyparks
Advisor
Advisor
Accepted solution

I could do what you say but there are 100+ files in the drawings I am trying to copy with special part numbers to get certain rows to combine.  Until about 30 minutes ago , just before I read your reply, I realized there is a find and replace function in the BOM that I had never noticed before.  All I have to do is expose all of the files, select everything at once and then right click on the selected part number field and select replace.  This did exactly what I needed in about 60 seconds or so on a 160 part assembly.  So to answer your question, apparently I don't need anything more than what is already there.  Thanks for the reply.

Please mark this response "Accept as solution" if it answers your question.
-------------------------------------------------------------------------------------
Corey Parks
0 Likes