Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

iLogic Bug - Cannot change the BOM structure of an assembly

matt_jlt
Collaborator

iLogic Bug - Cannot change the BOM structure of an assembly

matt_jlt
Collaborator
Collaborator

There seems to be a bug in iLogic in that it can't change the BOM structure in an assembly. It can read it but not modify it.

 

I have tried numerous methods of changing it. One example is below, the code below works perfectly in VBA but does not work in iLogic.

 

Public Sub AssyBOMTest()
   Dim oDoc As Document
   Set oDoc = ThisApplication.ActiveDocument
   Dim oCompDef As ComponentDefinition
   Set oCompDef = oDoc.ComponentDefinition
   oCompDef.BOMStructure = kPurchasedBOMStructure
End Sub

I came across this problem while trying to solve the issue for someone else but wanted to make a post addressing the issue directly.

https://forums.autodesk.com/t5/inventor-customization/microsoft-net-error/m-p/7465590/highlight/fals...

 

If anyone can help that would be great.

 

Thanks, Matt.

0 Likes
Reply
Accepted solutions (1)
391 Views
2 Replies
Replies (2)

MechMachineMan
Advisor
Advisor
Accepted solution

Based on the assosciated Imports and the languages, the required for enumerators are different.

 

In vba you can get away with just the enum, but in vb.net you need to put in the Enum Type. 

 

The safest way across all languages is to just extract what the integer is and to use that instead.

 

This is not a bug/ this behavior is well known.

 

Try using the code below.

 

Sub Main()
   Dim oDoc As Document
   oDoc = ThisApplication.ActiveDocument
   Dim oCompDef As ComponentDefinition
   oCompDef = oDoc.ComponentDefinition
   oCompDef.BOMStructure = BOMStructureEnum.kPurchasedBOMStructure
End Sub

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

matt_jlt
Collaborator
Collaborator

Hi Justin, thanks for your reply. It must have been an issue with the install as I had tested your suggestion previously and it didn't work. I tried a different machine this morning and it worked like a charm. I guess i'll have to run the reset inventor tool.

 

Thanks for your help, Matt.

0 Likes