Microsoft .Net FrameWork Error When Adding iLogic Rules

Microsoft .Net FrameWork Error When Adding iLogic Rules

e_frissell
Advocate Advocate
1,266 Views
8 Replies
Message 1 of 9

Microsoft .Net FrameWork Error When Adding iLogic Rules

e_frissell
Advocate
Advocate

Hi guys, I've written a lot of iLogic rules in my life however recently a couple things have been happening.  First is that my iLogic rules disappear and I need to re-add them, and second is I started getting an error saying "Unhandled exception has occurred in a component in your application.  If you click Continue, the application will ignore this error and attempt to continue

Unspecified error (Excpetion from HRESULT: 0X80004005(E_FAIL))."

 

Lot more to the error however it's extremely long.

 

Anyone ever seen this or have any idea how this can occur?  Could it be from having an iLogic rule in the folder that doesn't compile?  This is pretty new to me and I'm not sure what's wrong here

0 Likes
Accepted solutions (1)
1,267 Views
8 Replies
Replies (8)
Message 2 of 9

bradeneuropeArthur
Mentor
Mentor

could you upload an example?

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 3 of 9

e_frissell
Advocate
Advocate

An example of the error?  It looks like 1500 lines of this

See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.Runtime.InteropServices.COMException (0x80004005): Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))
   at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData& msgData)
   at Inventor.ControlDefinitions.AddButtonDefinition(String DisplayName, String InternalName, CommandTypesEnum Classification, Object ClientId, String DescriptionText, String ToolTipText, Object StandardIcon, Object LargeIcon, ButtonDisplayEnum ButtonDisplay)
   at iLogic.CustomButtonDefinition.ExternalRulesButtonManager.CreateRuleCommand(String filePath, String rootPath)
   at iLogic.IlogicBrowserTreeEditDialog.AddAdditionalExternalRule(String fileName)
   at iLogic.IlogicBrowserTreeEditDialog.ChooseAndAddExternalRule()
   at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
   at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
   at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ToolStrip.WndProc(Message& m)
   at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.9181.0 built by: NET481REL1LAST_C
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll
----------------------------------------

 

A reproduceable example might mean I have to upload my entire iLogic collection...

0 Likes
Message 4 of 9

Frederick_Law
Mentor
Mentor

@e_frissell wrote:

 First is that my iLogic rules disappear and I need to re-add them

 


"Disappear"?

The files deleted?

iLogic folder moved, renamed?

Win 10?

Win 11?

Reinstall Inventor?

Reinstall Dot Net?

 

Your rules referencing other dlls?

0 Likes
Message 5 of 9

e_frissell
Advocate
Advocate

Removed from iLogic browser in Inventor 23 on Windows 11.  

 

iLogic rules do not reference any dll's

 

Several iLogic rules, when added back to iLogic browser, create that error.  Occasionally all iLogic rules are removed from browser and need to be added back, sometimes only the rule that causes the error

 

Fix for now is move that rule to a different folder, open it in notepad++, create new rule in inventor, copy and paste into iLogic IDE and save.

 

Might be corrupted rules?

0 Likes
Message 6 of 9

Frederick_Law
Mentor
Mentor

Don't think rules are corrupted.  As you can see they're text files.

Path too long?

Rule file names too long?

Duplicated rules name in different folders?

Too many rules?

0 Likes
Message 7 of 9

WCrihfield
Mentor
Mentor
Accepted solution

Hi @e_frissell.  It sort of sounds like this may have something to do with buttons you have added into your ribbons for running external iLogic rules.  I also experienced some problems somewhat recently having to do with them that I consulted with Autodesk tech support and our local Autodesk solutions provider about.  I sort of ended up figuring out what was causing it and reported it to them as something that needed to be fixed on their end.  Basically, any time one of my external iLogic rules had the "&" character included somewhere within its name, and I included a button for that rule in one of my ribbons somewhere, that would cause the problem to occur.  After that point, the rules would remain in the ribbon until I closed or restarted Inventor, then they would be gone.  Not just that rule, but all user interface customizations were blown away.  And if I saved saved the customization to an external XML file while there was a rule button like that somewhere, that customization file could not be used at all.  Trying to use it does absolutely nothing.  It had nothing at all to do with the contents of the rules.  Only that character in the file's name.  The rule could be empty, or full of common code, and it would still cause the same problem.  I could simply rename that rule, without changing anything else about it, then it would let me add a ribbon button for it later without causing any more issues.  I am not sure if there may be other special characters that might cause problems in external rules names, but do avoid that one.  There may also be other bugs in their newly added system for allowing us the ability to add buttons for external iLogic rules to our ribbons.  Before we were given this ability, I was adding some buttons to a couple of my ribbons to run external rules using other external iLogic rules, the Event Triggers, and some custom event handlers for when the buttons were clicked.  But they needed to be added again every time Inventor was started and the first document was opened, because I do not have the admin rights on my work computer to create add-ins to take care of that task.

 

Edit:  I took a long time typing (and doing other things), so this reply may not be very relevant.  Last response I saw was Message 3.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 8 of 9

e_frissell
Advocate
Advocate

Your issue mostly resembles mine but I didn't have any special characters in the rule names.  What I did was move all my rules to a new folder, opened those iLogic rules one at a time in notepad++, created new rules,  copied the code from notepad++ into the new rule and saved them in my iLogic folder.  So far they haven't blow up yet and I still have copies of my original iLogic scripts when I need to reference them.  Not sure what broke but this was my fix

0 Likes
Message 9 of 9

WCrihfield
Mentor
Mentor

I'm glad to hear that you have been able to move on from the problems you were having.  This sounds like the type of thing that you should report to the folks at Autodesk tech support(Link, Link, Link).  If you are able to do that, they can take note of the issues you are having, check if there are any other similar sounding cases going on, and if they are able to figure it out, they can forward the relevant into to the right folks at Autodesk to hopefully get it fixed in an update to the software.  That is the same type of error that was encountered in this other recent forum thread related to iLogic Forms and the group tabs within them.

https://forums.autodesk.com/t5/inventor-programming-ilogic/form-editor-unhandled-exception-error/td-... 

They usually always want you to pinpoint the issue in a way that they can reproduce on their end somehow, or they may want you to send them a set of files that seem to be causing the problems to happen, which is not always a simple task.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes