Error 0x80004005 accessing BomView with All levels in Structured settings

Error 0x80004005 accessing BomView with All levels in Structured settings

Maxim-CADman77
Advisor Advisor
500 Views
3 Replies
Message 1 of 4

Error 0x80004005 accessing BomView with All levels in Structured settings

Maxim-CADman77
Advisor
Advisor

I'd like to know if it normal to get Error Hresult 0x80004005 trying to access BomView (Dim oBV As BOMView=oBOM.BOMViews.Item(2) )  with Level property value "All levels" in Structured Properties.

I believe  this problem is actual not for all IAMs.

PS: Switching the "Level" Property value to "First level" workarounds the problem but I'd rather prefer to be able read First Level BOM regardless the level value.

Please vote for Inventor-Idea Text Search within Option Names

0 Likes
Accepted solutions (1)
501 Views
3 Replies
Replies (3)
Message 2 of 4

Sergio.D.Suárez
Mentor
Mentor

Hi, I usually use these lines to access the bomview.
You should check that this code segment works for you in the files where you find the error. It is likely that the error may be elsewhere, I would have to see well the code you have.

 

Dim oDoc As AssemblyDocument
oDoc = ThisDoc.Document

Dim oBOM As BOM
oBOM = oDoc.ComponentDefinition.BOM
    ' Set the structured view to 'all levels'
oBOM.StructuredViewFirstLevelOnly = False
    ' Make sure that the structured view is enabled.
oBOM.StructuredViewEnabled = True
    ' Make sure that the parts only view is enabled.
oBOM.PartsOnlyViewEnabled = True
    
Dim oBV As BOMView = oBOM.BOMViews.Item(2)

 


Please accept as solution and give likes if applicable.

I am attaching my Upwork profile for specific queries.

Sergio Daniel Suarez
Mechanical Designer

| Upwork Profile | LinkedIn

0 Likes
Message 3 of 4

chandra.shekar.g
Autodesk Support
Autodesk Support

@Maxim-CADman77,

 

Error may be a reason which is explained at below blog link.

 

https://knowledge.autodesk.com/support/inventor-products/troubleshooting/caas/sfdcarticles/sfdcartic...

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



0 Likes
Message 4 of 4

Maxim-CADman77
Advisor
Advisor
Accepted solution

Thank you both for attempt to help but neither of suggestions helped.

As for today i belive that have fixed this.

Some 3Dmodels give failure when attempt to access Structured View (when it is open in UI BOM looks empty). These are some unhealthy state of the Document itself.

Another case was that pretty much health iFactory 3Dmodels don't have data regarding some components (those exluded in the current member).

In both cases the cure was Try-Catch-End Try placed accordingly...

Please vote for Inventor-Idea Text Search within Option Names

0 Likes