Inventor Customization

Reply
Mentor
mslosar
Posts: 247
Registered: ‎08-11-2004
Message 1 of 8 (298 Views)
Accepted Solution

Can you override an iLogic trigger?

298 Views, 7 Replies
02-11-2013 07:27 AM

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?

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

 

Restart Inventor

 

Then Open your part 

*Expert Elite*
jdkriek
Posts: 528
Registered: ‎03-29-2007
Message 2 of 8 (295 Views)

Re: Can you override an iLogic trigger?

02-11-2013 07:59 AM in reply to: mslosar

You might try Code Injector

 

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

Jonathan D. Kriek

Autodesk Inventor Certified Expert
Microsoft Certified Application Developer
_____________________________________________________
Did I help you? Please choose Accept as Solution or Kudos below
ADN Support Specialist
Vladimir.Ananyev
Posts: 477
Registered: ‎08-14-2012
Message 3 of 8 (290 Views)

Re: Can you override an iLogic trigger?

02-11-2013 08:22 AM in reply to: mslosar

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


Vladimir Ananyev
Developer Technical Services
Autodesk Developer Network

*Expert Elite*
jdkriek
Posts: 528
Registered: ‎03-29-2007
Message 4 of 8 (285 Views)

Re: Can you override an iLogic trigger?

02-11-2013 08:27 AM in reply to: Vladimir.Ananyev

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

 

Restart Inventor

 

Then Open your part 

Jonathan D. Kriek

Autodesk Inventor Certified Expert
Microsoft Certified Application Developer
_____________________________________________________
Did I help you? Please choose Accept as Solution or Kudos below
Mentor
mslosar
Posts: 247
Registered: ‎08-11-2004
Message 5 of 8 (282 Views)

Re: Can you override an iLogic trigger?

02-11-2013 08:32 AM in reply to: Vladimir.Ananyev

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?

*Expert Elite*
jdkriek
Posts: 528
Registered: ‎03-29-2007
Message 6 of 8 (253 Views)

Re: Can you override an iLogic trigger?

02-15-2013 12:37 PM in reply to: mslosar

Please .zip and post the models.

Jonathan D. Kriek

Autodesk Inventor Certified Expert
Microsoft Certified Application Developer
_____________________________________________________
Did I help you? Please choose Accept as Solution or Kudos below
Mentor
mslosar
Posts: 247
Registered: ‎08-11-2004
Message 7 of 8 (248 Views)

Re: Can you override an iLogic trigger?

02-15-2013 01:01 PM in reply to: jdkriek

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.

*Expert Elite*
jdkriek
Posts: 528
Registered: ‎03-29-2007
Message 8 of 8 (243 Views)

Re: Can you override an iLogic trigger?

02-15-2013 01:39 PM in reply to: mslosar

Understood. 

 

Glad you got it working.

Jonathan D. Kriek

Autodesk Inventor Certified Expert
Microsoft Certified Application Developer
_____________________________________________________
Did I help you? Please choose Accept as Solution or Kudos below
Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.