iLogic Code Error, (Exception from HRESULT: 0x80004005 (E_FAIL))

iLogic Code Error, (Exception from HRESULT: 0x80004005 (E_FAIL))

Anonymous
Not applicable
944 Views
1 Reply
Message 1 of 2

iLogic Code Error, (Exception from HRESULT: 0x80004005 (E_FAIL))

Anonymous
Not applicable

Hi,
 
I have some code that calculates cross-sectional area and area moments of inertia for a part file. Now I am trying to use the same code in an assembly file, and I am getting the following error:
 
     Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))
 
From what I've read on the forums, it seems there can be several different issues that cause this. What can I do to fix my code?
 
I attached the assembly file which contains the iLogic code, as well as the part files that I was using with the code.  (I have commented out some of my code, so I can focus on getting the basics first).
 
Thanks.

0 Likes
945 Views
1 Reply
Reply (1)
Message 2 of 2

MjDeck
Autodesk
Autodesk

This method won't work in an assembly because the Project Cut Edges command is not available in an assembly sketch. Maybe there's another way to do it.

 

In general, when you get one of these error messages the first place to look is on the More Info tab on the dialog. If the info there doesn't relate to your rule code, it might help if you add more Dim messages to the rule. You don't have to specify the type in most cases. Just use Dim by itself and the compiler will infer the type. Here's the first part of your rule with Dim statements added:

'Preliminary Setup
Dim App = ThisApplication
Dim doc As AssemblyDocument = ThisDoc.Document
Dim oCD = doc.ComponentDefinition
Dim oBodies = oCD.SurfaceBodies
Dim oCommandMgr = App.CommandManager
Dim oFace As Face

Mike Deck
Software Developer
Autodesk, Inc.