Can you override an iLogic trigger?

Can you override an iLogic trigger?

mslosar
Advisor Advisor
950 Views
7 Replies
Message 1 of 8

Can you override an iLogic trigger?

mslosar
Advisor
Advisor

I've got an assembly and parts controlled by an excel file.

 

I made a small change to the excel file and now when I try to open the assembly i get a catastrophic error that is pointing to one of the ilogic routines i have in the assembly.

 

Now, there are no complex routines here. The rule it's pointing to is basically:

 

If parameter = 1 then

 suppress this part

 activate this part

 

else

 

 activate this part

 suppress this part

 

end if

 

Obviously that's not the exact/proper syntax - but that's the extent of the rule. And it's worked just fine til this morning. FWIW, the change in the excel file was altering the size - not structural. The parts still open and adjust accordingly.

 

I set the ilogic trigger to run when the file is opened. Now, i can't access the file period. Is there a key you can hit or something to keep the trigger from activating? or is this assebly just shot?

0 Likes
Accepted solutions (1)
951 Views
7 Replies
Replies (7)
Message 2 of 8

jdkriek
Advisor
Advisor

You might try Code Injector

 

I've had some luck deleting iLogic Rules that would normally instantly crash Inventor.

Jonathan D. Kriek
MFG Solutions Engineer
KETIV Technologies, Inc.


0 Likes
Message 3 of 8

Vladimir.Ananyev
Alumni
Alumni

Is it possible to load your assembly after iLogic AddIn is disabled?


Vladimir Ananyev
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 4 of 8

jdkriek
Advisor
Advisor
Accepted solution

Go To Tools -> Add-Ins -> iLogic -> and uncheck "Load On Startup".

 

Restart Inventor

 

Then Open your part 

Jonathan D. Kriek
MFG Solutions Engineer
KETIV Technologies, Inc.


0 Likes
Message 5 of 8

mslosar
Advisor
Advisor

I was able to get back in by loading a back up of my excel file.

 

Here's my ilogic code which i've reduced to this:

 

if FLG_TYPE = 1 then

 

Component.Replace("U_Tip_Flange:1", "U_Tip_Flange.ipt", True)

 

ELSE

 

Component.Replace("U_Tip_Flange:1", "U_Tip_Plate_Flange.ipt", True)

 

End if

 

 

 

If the FLG_TYP is anything other than 1 when loading the file, i get this message:

 

iLogic Rule Error in rule: FlangeSwap, in document: U_TIP_ASSY.iam (U-Tip)

Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))

 

This is the second tab.


System.Runtime.InteropServices.COMException (0x8000FFFF): Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))
   at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData& msgData)
   at Inventor.ComponentOccurrence.Replace(String FileName, Boolean ReplaceAll)
   at iLogic.ComponentInRule.Replace(Object componentName, String newFileName, Boolean replaceAll, Boolean ignoreError)
   at iLogic.ComponentInRule.Autodesk.iLogic.Interfaces.ICadComponent.Replace(Object componentName, String newFileName, Boolean replaceAll, Boolean ignoreError)
   at LmiRuleScript.Main()
   at Autodesk.iLogic.Exec.AppDomExec.ExecRuleInAssembly(Assembly assem)
   at e.a(String A_0)

 

It works JUST FINE if the rule is not run on file open. Manual, just fine. On change, just fine, on save, just fine. What's the problem at startup? Especially considering I run the same basic code on a couple other pieces and they cause no problems. I even use it on a series of 5 different numbers (if 1, 2, 3, etc) on another part/sub and it works no problem.

 

Every object is grounded in place, none are used in any constraints.

 

Why would it cause issues only in open and only on this piece? Could be related to it being the first part in the assembly?

0 Likes
Message 6 of 8

jdkriek
Advisor
Advisor

Please .zip and post the models.

Jonathan D. Kriek
MFG Solutions Engineer
KETIV Technologies, Inc.


0 Likes
Message 7 of 8

mslosar
Advisor
Advisor

Can't post the models, proprietary stuff unfortunately.

 

The problem has something to do with suppression and LOD's though.

 

I've replaced the above code with a version that makes the pieces invisible, disabled, and a bom structure of reference instead of using suppress and LOD.

 

Doing that and getting rid of the single LOD i had seems to make things a bit quicker and i'm not getting no errors.

 

The weirdest part before was that the error only occurred when using the trigger options to run the rule when opening the filed. Worked fine if you took it out of there and only had it set to run upon saving the file.

0 Likes
Message 8 of 8

jdkriek
Advisor
Advisor

Understood. 

 

Glad you got it working.

Jonathan D. Kriek
MFG Solutions Engineer
KETIV Technologies, Inc.


0 Likes