Cannot find a rule with the name "".

Cannot find a rule with the name "".

Anonymous
Not applicable
2,193 Views
5 Replies
Message 1 of 6

Cannot find a rule with the name "".

Anonymous
Not applicable

Error screen that pops up when loading the file

Screen 1.png

 

 Error screen tab2 (more info)

Screen 2.PNG

 

 

No rules in Event Triggers:

Screen 3.PNG

 

Inventor 2017 Build 256, Release: 2017.4.1

 

This error only comes up with this file, and seems to happen before ilogic loads.  If i remove the check from "Run these rules when events occur" the error goes away.  it only happens on file load, and if I click ok, all of the other rules run fine, even if I put rules into the event triggers, they work.

 

There were previously rules in "After open document", "Before save document", and "New document"  I have removed the triggers one by one to see if one of them was causing the issue, but I have now removed them all with no change.

 

There is an external rule that exists, it also runs fine if I run it manually (it was never in the triggers).

 

Anyone have any input towards possible causes/fixes?

0 Likes
Accepted solutions (3)
2,194 Views
5 Replies
Replies (5)
Message 2 of 6

Owner2229
Advisor
Advisor

Hey, my 2 cents:

In Inventor press Alt+F11.

A window pops up.

On the left side, in project tree expand all modules and one by one open them and check if there's any code.

If there is, you can either remove it or (if you're not sure what it does) you can post it here and I (or someone else) will tell you so.

Consider using "Accept as Solution" / "Kudos" if you find this helpful.
- - - - - - - - - - - - - - -
Regards,
Mike

"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - John F. Woods
0 Likes
Message 3 of 6

Curtis_Waguespack
Consultant
Consultant
Accepted solution

Hi Telson.Hadden,

 

Is this (or was this) an iPart file, meaning iPart factory or iPart member?

 

see this link:

https://forums.autodesk.com/t5/inventor-forum/invisible-link-to-external-ilogic-rule/m-p/6834032#M62...

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

 

EESignature

Message 4 of 6

Anonymous
Not applicable

Not an iPart, it only happens in the assembly file (and parent assemblies/presentation files) but none of the component parts.  It only happens on file open, I can't even track down what it's looking for.

0 Likes
Message 5 of 6

Anonymous
Not applicable
Accepted solution

So it was definitely a phantom trigger somewhere, fixed by this external rule (called "_DeleteTriggers"):

code is pinched from various places (thanks to uncredited authors)

Sub Main()
		Dim BaseName As String
		Dim BaseID As Integer
		Dim BaseUse As String
		Dim EndHolder As Integer = 0 'EndHolder will act as the numerical value that will be attached to the end of the property name.
		Dim oCurrentDoc as Object = ThisDoc.Document
		
		'define the ilogicAutomation
		Dim iLogicAuto As Object 
		iLogicAuto = iLogicVb.Automation 
	
		If oCurrentDoc.DocumentType = 12291 'it's an assembly file
			For Each docFile In oCurrentDoc.AllReferencedDocuments
				iLogicAuto.RunExternalRule(docFile, "_DeleteTriggers")
			Next docFile
		End If
		
		Try
			customIPropSet = oCurrentDoc.PropertySets.Item("iLogicEventsRules")
		Catch
		End Try
		Try
			If customIPropSet Is Nothing Then
				customIPropSet = oCurrentDoc.PropertySets.Item("_iLogicEventsRules")
			End If
		Catch 
		End Try
	
		Try
			If customIPropSet.InternalName <> "{2C540830-0723-455E-A8E2-891722EB4C3E}" Then
				Call customIPropSet.Delete
				customIPropSet = oCurrentDoc.PropertySets.Add("iLogicEventsRules", "{2C540830-0723-455E-A8E2-891722EB4C3E}")
			End If
		Catch 
		End Try
	
		Try
			If customIPropSet Is Nothing Then
				customIPropSet = oCurrentDoc.PropertySets.Add("iLogicEventsRules", "{2C540830-0723-455E-A8E2-891722EB4C3E}")
			End If
		Catch 
		End Try
	
		If customIPropSet Is Nothing Then
				MsgBox("Unable to delete the Event Triggers property for this file!", , "Event Triggers Not Set")
			Exit Sub
		End If
						
		If customIPropSet.Count > 0 Then
		'We'll make a loop! This will go through each Property (Event Trigger), 1 Property at a time
			For propItemCounter = 1 To customIPropSet.Count Step 1
				Try
					customIPropSet.Item(propItemCounter).delete
				Catch
				End Try
			Next
		End If	
	End Sub

 

Message 6 of 6

Anonymous
Not applicable
Accepted solution

Need a slight change to this code to make it actually work...

 

The counter needs to go backwards.  If you have 4 triggers, when you delete #1 and #2, then #3 will fail, because there are only 2 total triggers.

 

So:

SyntaxEditor Code Snippet

For propItemCounter = customIPropSet.Count To 1 Step -1

 

and bob is as they say, your uncle.

 

0 Likes