SubOccurrences property throw COMException

SubOccurrences property throw COMException

FRFR1426
Collaborator Collaborator
1,038 Views
4 Replies
Message 1 of 5

SubOccurrences property throw COMException

FRFR1426
Collaborator
Collaborator

When trying to loop on sub occurrences, on some assemblies, the property SubOccurences thow a COMException:

 

System.Runtime.InteropServices.COMException (0x80004005): Erreur non spécifiée (Exception de HRESULT : 0x80004005 (E_FAIL))
   à System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData& msgData)
   à Inventor.ComponentOccurrence.get_SubOccurrences()

What can cause this type of error? 

 

Maxence DELANNOY
Manager
Add-ins development for Autodesk software products
http://wiip.fr
0 Likes
Accepted solutions (1)
1,039 Views
4 Replies
Replies (4)
Message 2 of 5

YuhanZhang
Autodesk
Autodesk

Can you upload the data that can reproduce this problem? And which Inventor version you are using?

 

Please don't upload confidential data.



If this solves the problem please click ACCEPT SOLUTION so other people can find it easily.



Rocky Zhang
Inventor API PD
Manufacturing Solutions
Autodesk, Inc.

0 Likes
Message 3 of 5

FRFR1426
Collaborator
Collaborator

The problem occurs on Inventor Suite 2011 SP2 (Build 150309200, 309). I will upload some data, but via ADN DevHelp because the data is confidential (when it will work, which is not the case right now. I can not connect Smiley Frustrated)

Maxence DELANNOY
Manager
Add-ins development for Autodesk software products
http://wiip.fr
0 Likes
Message 4 of 5

nagwani
Alumni
Alumni
Accepted solution

Hi There,

 

I had similar issue once, and I found that if your are not in Master LOD and some of the occurrences have been suppresses then getting SubOccurrences from suppressed Occurrence would fail.

 

Regards,

-Ishwar N

Message 5 of 5

FRFR1426
Collaborator
Collaborator

Found it! I have to test the property Suppressed before accessing to the property SubOccurences.

Maxence DELANNOY
Manager
Add-ins development for Autodesk software products
http://wiip.fr
0 Likes