Error accessing BOMStructure of weldment occurrence

Error accessing BOMStructure of weldment occurrence

Anonymous
Not applicable
285 Views
2 Replies
Message 1 of 3

Error accessing BOMStructure of weldment occurrence

Anonymous
Not applicable

I'm getting an error when trying to query the BOMStructure of a weldment assembly occurrence.

 

For Each oCompOcc As ComponentOccurrence in oOccs

Try

       bomStruc = oCompOcc.Definition.BOMStructure

Catch

      msgbox(oCompOcc.Name)

End Try

 

I get a message box for every weldment assembly the loop encounters.

 

Error Message:

Not implemented (Exception from HRESULT: 0x80004001 (E_NOTIMPL))

0 Likes
286 Views
2 Replies
Replies (2)
Message 2 of 3

JamieVJohnson2
Collaborator
Collaborator

What did you define bomStruc as?  It should be of type BOMStructureEnum, but I can't verify that from your snippet.  The other question, is the system attempting to report a BOMStructureEnum value that is not in the Enum list? 51969-51975.  Welded parts are generally (by default) 51974 - Inseparable.

 

For it to say E_NotImplemented means the API is being asked to do something that wasn't completely written for it.  But this feature has been around in version 10, so that shouldn't be the case.  Unless they broke something, or your document is somehow corrupted, and in the process of getting that value, it runs into a sub-error that bubbles up as shown.

 

To aide in removing corruption from the equation, use the total-rebuild feature on all documents (or do a migration with total-rebuild feature turned on).  If possible it would be helpful to see a copy of the document with the welded structure that is failing.  Perhaps if only a single set of 2 parts and a single weld (if that also fails).  We can use that to dive deeper with you.

 

 

Jamie Johnson : Owner / Sisu Lissom, LLC https://sisulissom.com/
0 Likes
Message 3 of 3

Anonymous
Not applicable

Hi Jamie, thanks for your input.

I think I discovered the problem. I'm looping through AllLeafOccurrences, which should only include parts, but I've discovered it also includes weldment assemblies.

2019-01-04_13h37_24.png

 

 

I was trying to access the BOMStructure through the component definition on an object of type ComponentOccurrenceProxy. When my loop encountered any weldment, it produced the error previously mentioned.

 

But if I access it via the occurrence itself (ComponentOccurrence.BOMStructure) it works fine, no error.

 

I dislike looping through occurrences, I much prefer looping through AllReferencedDocuments, but I need to query the suppression state of each document and I'm unaware of anyway to achieve this other than though the occurrence object (ComponentOccurrence.Suppressed).

 

Any idea if its possible to do via the referenced document?

0 Likes