BOM row ComponentDefinitions null after updating file reference

BOM row ComponentDefinitions null after updating file reference

AdrianSaf
Enthusiast Enthusiast
469 Views
2 Replies
Message 1 of 3

BOM row ComponentDefinitions null after updating file reference

AdrianSaf
Enthusiast
Enthusiast

I have an assembly like this that contains a link to an Ipt:

Asm1.iam

--> Part1.ipt

 

In an external c# stand alone application, using Inventor 2018 Application COM:

  • I do a ReplaceReference on the Part1.ipt to change it to Part1_1.ipt (it's just a copy of the original ipt with the part number changed) - this works with no problem.
  • After I do this I try to read the structured BOM on the iam (I'm reading the part number for each row). When I get to the row associated with the ipt the ComponentDefinitions property for the row is  null.
  • I tried doing and Update on the document before reading the BOM, also tried a save (even a rebuild) - this did not solve anything. The only thing I found that fixes this (to get ComponentDefinitions for the row) is to save the iam document and then reopen it.
  • It seems to me like there should be a way to force the refresh without needing to re-open the file (it take time to do that) - is there a method ?
0 Likes
470 Views
2 Replies
Replies (2)
Message 2 of 3

MechMachineMan
Advisor
Advisor

Maybe it's an issue of your variable still accessing old data instead of seeing new stuff? try accessing the BOM again from the document and then going down to the component definition?


--------------------------------------
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

AdrianSaf
Enthusiast
Enthusiast

Hello,

I don't get the bom until I make the reference changes - so there is no variable to refresh - only the one keeping the document.

0 Likes