Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Exception has been thrown by the target of an invocation??

2 REPLIES 2
Reply
Message 1 of 3
SteveX82
3010 Views, 2 Replies

Exception has been thrown by the target of an invocation??

I've encountered a weird error message when trying to manually run 2 of the ~30 or so rules in my top level assembly. Both of these rules behave perfectly when triggered by the iTrigger button (which, in turn, fires a rule I found on this forum that runs all other model rules), but they error out if I right-click/Run or manually alter the iTrigger parameter value.

 

The error message reads as follows:

 

 

 

"Exception has been thrown by the target of an invocation.

 

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException (0x80004005): Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))

--- End of inner exception stack trace ---

at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters)

at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)

at iLogic.CadObjectUtil.SetPropertyValue(Object obj, String propertyName, Object value)

at iLogic.AssemConstraintForRule.set_IsActive(String constraintName, Boolean value)

at LmiRuleScript.Main()

at Autodesk.iLogic.Exec.AppDomExec.ExecRuleInAssembly(Assembly assem)

at iLogic.RuleEvalContainer.ExecRuleEval(String execRule)"

 

 

 

I've narrowed down the error and found that it somehow involves my use of the Constraint.IsActive functions in each rule. Depending on which components are active, I must suppress and activate different sets of constraints. Similar constraint rules work flawlessly in other rules, and these rules work fine when used with the iTrigger button, but they have me pulling my hair out in this case. The error disappears if I comment out the lines involving Constraint.IsActive.

 

Can anybody shed some light on this weird error message? I've tried duplicating the error in a simple example assembly that I could upload to the forum, but I've been unsuccessful (or successful, depending on how you look at it...) so far.

 

Thanks in advance,

Steve

2 REPLIES 2
Message 2 of 3
LOONYLEN
in reply to: SteveX82

Maybe one of the ilogic experts that work at Autodesk could help with this issue.

 

These rules worked correctly in the past, before you migrated to Inventor 2012, is this true?

Could you paste the code that you've written for us to take a look at?

Also, maybe your data set?

 

Thanks

Senior Designer/Cad Administrator
Inventor 2012, w/SP2
Vault Collaboration 2012
Dell Precision T3500, Intel Xeon CPU
W3680 @3.33GHz, 16.0 GB of RAM
Microsoft Windows 7 Pro, 64 Bit Edition
Version 2009, w/SP1
Message 3 of 3
alh-telesis
in reply to: LOONYLEN

We have the same error, but only when checking in AutoCAD Mechanical 2012 drawings.

We have NOT seen this error with any Inventor 2012 files.

 

A work around that was suggested to us was to checkout another file, then check it back in.

That is "supposed" to clear the pipes for the file that didn't check in.

It doesn't seems to work every time, but it's the only thing I've heard of.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums