Getting error when running rule in an assembly

Getting error when running rule in an assembly

cadprof
Enthusiast Enthusiast
490 Views
3 Replies
Message 1 of 4

Getting error when running rule in an assembly

cadprof
Enthusiast
Enthusiast

Hello, It's been a while since I wrote iLogic code and I'm running into an error every time I execute the rule from within the top assembly. The rule looks for a parameter change. Individual parts and subassemblies are then changed also, and the top assembly updates. I have a subassembly that is throwing up the error in my rule. I have looked into the subassembly for typo's or other mistakes and cannot figure where the problem is.  The rule in the top assembly gives me the following error:

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.Parameter.set_Value(Object )
at iLogic.ParamDynamicFinder.SetParamValue(Parameter param, Object value, Boolean doUpdate)
at ThisRule.Main() in rule: FEED_ACCEPT_ONLY_CHANGE, in document LW100-FEED-ACCEPT.iam:line 9
at Autodesk.iLogic.Exec.AppDomExec.ExecRuleInAssembly(Assembly assem)
at iLogic.RuleEvalContainer.ExecRuleEval(String execRule)

 

Is there anything specific I should be looking for in the subassembly? 

I'm running:

Inventor 2022   64 Bit

Build 350, Release 2022.3

 

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

WCrihfield
Mentor
Mentor
Accepted solution

Hi @cadprof.  The error data you posted indicates that it is encountering the error at a point where it is trying to set a value to a parameter.  I can not tell from that error if it is trying to access a parameter within the main assembly, the sub-assembly, or a part.  One of the most common problems in these kinds of situations is using the wrong document reference, or using an iLogic shortcut snippet without specifying a component name or document name for it to target.  Is it possible for you to post your code here, maybe as 1 or more text files, so we can help you proofread it for errors?  If you do post something, make sure it does not contain any personal or proprietary data.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 3 of 4

cadprof
Enthusiast
Enthusiast

Hello,

Thank you for giving me some items to look for in my code. I will take another look at it and if I cannot find my error, I'll definitely post the code for more help.

Thank again!

0 Likes
Message 4 of 4

cadprof
Enthusiast
Enthusiast
I wanted to let you know that with your response to my problem I went back through my iLogic rules and found the problem. Thanks again.
0 Likes