iLogic logic rule error (catastrophic) with basic code

iLogic logic rule error (catastrophic) with basic code

mslosar
Advisor Advisor
1,306 Views
4 Replies
Message 1 of 5

iLogic logic rule error (catastrophic) with basic code

mslosar
Advisor
Advisor

I'm getting this error with the most basic of code. The error ONLY appears if the rule is run during opening of the file, otherwise it works fine. It also seems to work on other objects.

 

Here's the full issue:

 

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?

 

Seems to me it's something wrong in the plate flange part itself (which seems to be just fine on it's own) or a problem in iLogic itself for rules run in the opening of a file.

 

This is Inventor 2010 fwiw (awaiting IT to get us 2013).

0 Likes
1,307 Views
4 Replies
Replies (4)
Message 2 of 5

xiaodong_liang
Autodesk Support
Autodesk Support

Hi,

 

I created a simple assembly with a simple part, created rule to replace the part with the other part, and selected Event Trigger [After Open Document ]. finally closed the assembly. After I re-opened the assembly, the part is replaced correctly. I did not receive any error.

 

Is this problem reproducible with specific document or steps?

0 Likes
Message 3 of 5

mslosar
Advisor
Advisor

I did the same thing. I actually did it just as you said 5-6 times.

 

I got it to work correctly once. This was back on the date of my original post.

 

I've gotten various errors in this project with ilogic rules. For the most part, it seems as if taking them out of [After Open Document] seems to have solved the issue. Invoking the [Before Document Save] has always worked without issue.

 

Where the intiial errors occurred was a top level assembly that had about 6 rules that ran on open. On top of that, many of the subassemblies and parts had their own rules as well. I wondered if it just the overall number of rules. That's why I tried a blank assembly and two junk parts. That worked initially, but failed shortly thereafter.

 

I'll run through them again and see what happens.

0 Likes
Message 4 of 5

mslosar
Advisor
Advisor

I just did it once with basic parts and it worked.

 

I then added a blank spreadsheet with 1 parameter in it. Save the assembly, closed it, changed the paramter in excel and saved it, then opened the assembly and got one of my favorite errors 'Cannot find the rule'. Click OK and it opens and does not switch parts (though it should have). Tried it 3 more times. Every time I save the assembly, then change the value in the excel file, then open the assembly, I get the 'Cannot find rule' error and have to manually run the rule which then runs perfectly fine.

 

I've done it repeatedly now and can't get past 'Cannot find rule'.

 

Doubt that it matters, but i'm running a local project file, not vault, and the assembly and excel file were in the top level folder and the parts were under the parts subfolder.

 

When the catastrophic error popped up last week, i hadn't seen it before. I had seen the cannot find rule error referencing another rule on very rare occasion prior to the catastrophic though. Now, I can't get to the catastrpohic because the can't find rule error would be blocking it.

 

I'm in Inv 2010, sp4, with ilogic, and sheet metal hotfix added.

 

Attached is my little sample version generating the can't find rule error as noted above.

0 Likes
Message 5 of 5

mslosar
Advisor
Advisor

I've run into 'Cannot find the rule' again this morning.

 

Looking in to that, I can't seem to find a trace of it online anywhere. Searches for Autodesk Inventor "cannot find the rule" on google, yahoo, and bing give me absolutely nothing. Same when searching the customization forum here.

 

Surely I can't be the first person to have encountered this error?

0 Likes