external rules not found

external rules not found

Bram_Jessen
Enthusiast Enthusiast
977 Views
5 Replies
Message 1 of 6

external rules not found

Bram_Jessen
Enthusiast
Enthusiast

Hello all,

 

Ive made a Ilogic rule with help from this forum (by searching/borrowing and asking), this rule works.

BUT, when we start fresh (or reboot the computers) the external rules listed in the Ilogic are not found. This results in a error, obviously:

Error on line 24 in rule: iLogic - REV - Goedkeuren, in document: 011-620066.ipt

RunExternalRule: Cannot find an external rule file named: "iLogic - generate thumbnail" (referenced in the document 011-620066.ipt).

 

When we run the external rule by hand, it's no problem. The original ilogic is then triggered again (manual) and it give the next external rule error. So the process is repeated, running the external rule by hand. until all external rules are once run manual. Then the original rule runs fine, the whole day.

Until we fire up the computer the next day.

 

We haven't had this problem with external rules before, and as far as i know we didn't change any settings.

 

Does anyone know what is happening here? And more important: how we can fix this once and for all?

 

Thanks in advance,

Bram Jessen

 

The code of the specified rule:

Try
If iProperties.Value("Project", "Part Number") = "" Then
iProperties.Value("Project", "Part Number") = InputBox("Artikel nummer", "Artikel nummer onbekend", "")
End If
Catch
End Try

'omdat de date creation box niet aangevinkt is geeft deze geen datum op de tekening, daarom onderstaande code om bij releasen deze aan te vinken (bram)
Dim oDoc As Document = ThisDoc.Document
oDoc.PropertySets.Item("Design Tracking Properties").Item("Creation Time").Value = DateTime.Now.ToString("d")

iLogicVb.RunExternalRule("iLogic - Auto - Tekening nummer")
'om een of andere domme reden is het niet mogelijk om de inhoud van deze ilogic op te roepen daarom is de logic maar gewoon hiergeplakt
Try
If Left(iProperties.Value("Project", "Part Number"), 3) = "011" Then
iProperties.Value("custom", "PosNr") = "T" & Right(iProperties.Value("Project", "Part Number"), 6)
Else
iProperties.Value("custom", "PosNr") = Right(iProperties.Value("Project", "Part Number"), 3)
End If
Catch
End Try
iLogicVb.RunExternalRule("iLogic - Auto - Update Materiaal omschrijving")
iLogicVb.RunExternalRule("iLogic - Excel - Mappen")
iLogicVb.RunExternalRule("iLogic - generate thumbnail")

Dim REV As String
Dim REVEDIT As String
Dim Export As String
Export ="JA"
REVEDIT = "Vrijgegeven"
REV = iProperties.Value("Project", "Revision Number")
Select Case REV
Case "-"
iProperties.Value("Project", "STATUS") = "Leverancier art."
Export = "NEE"
Case "*"
MessageBox.Show("Tekening is vervallen")
Export = "NEE"
Case ""
iProperties.Value("Project", "Revision Number")="0"
iProperties.Value("Project", "STATUS") = REVEDIT
case "0+"
iProperties.Value("Project", "Revision Number")="a"
iProperties.Value("Project", "STATUS") = REVEDIT
Case "a+"
iProperties.Value("Project", "Revision Number")="b"
iProperties.Value("Project", "STATUS") = REVEDIT
Case "b+"
iProperties.Value("Project", "Revision Number")="c"
iProperties.Value("Project", "STATUS") = REVEDIT
Case "c+"
iProperties.Value("Project", "Revision Number")="d"
iProperties.Value("Project", "STATUS") = REVEDIT
Case "d+"
iProperties.Value("Project", "Revision Number")="e"
iProperties.Value("Project", "STATUS") = REVEDIT
Case "e+"
iProperties.Value("Project", "Revision Number")="f"
iProperties.Value("Project", "STATUS") = REVEDIT
Case "f+"
iProperties.Value("Project", "Revision Number")="g"
iProperties.Value("Project", "STATUS") = REVEDIT
Case "g+"
iProperties.Value("Project", "Revision Number")="h"
iProperties.Value("Project", "STATUS") = REVEDIT
Case "h+"
iProperties.Value("Project", "Revision Number")="i"
iProperties.Value("Project", "STATUS") = REVEDIT
Case "i+"
iProperties.Value("Project", "Revision Number")="j"
iProperties.Value("Project", "STATUS") = REVEDIT
Case "j+"
iProperties.Value("Project", "Revision Number")="k"
iProperties.Value("Project", "STATUS") = REVEDIT
Case "k+"
iProperties.Value("Project", "Revision Number")="l"
iProperties.Value("Project", "STATUS") = REVEDIT
Case "l+"
iProperties.Value("Project", "Revision Number")="m"
iProperties.Value("Project", "STATUS") = REVEDIT
Case "m+"
iProperties.Value("Project", "Revision Number")="n"
iProperties.Value("Project", "STATUS") = REVEDIT
Case "n+"
iProperties.Value("Project", "Revision Number")="p"
iProperties.Value("Project", "STATUS") = REVEDIT
Case "p+"
iProperties.Value("Project", "Revision Number")="q"
iProperties.Value("Project", "STATUS") = REVEDIT
Case "q+"
iProperties.Value("Project", "Revision Number")="r"
iProperties.Value("Project", "STATUS") = REVEDIT
Case "r+"
iProperties.Value("Project", "Revision Number")="s"
iProperties.Value("Project", "STATUS") = REVEDIT
Case "s+"
iProperties.Value("Project", "Revision Number")="t"
iProperties.Value("Project", "STATUS") = REVEDIT
Case "t+"
iProperties.Value("Project", "Revision Number")="u"
iProperties.Value("Project", "STATUS") = REVEDIT
Case "u+"
iProperties.Value("Project", "Revision Number")="v"
iProperties.Value("Project", "STATUS") = REVEDIT
Case "v+"
iProperties.Value("Project", "Revision Number")="w"
iProperties.Value("Project", "STATUS") = REVEDIT
Case "w+"
iProperties.Value("Project", "Revision Number")="x"
iProperties.Value("Project", "STATUS") = REVEDIT
Case "x+"
iProperties.Value("Project", "Revision Number")="y"
iProperties.Value("Project", "STATUS") = REVEDIT
Case "y+"
iProperties.Value("Project", "Revision Number")="z"
iProperties.Value("Project", "STATUS") = REVEDIT

Case Else
MessageBox.Show("Artikel is al vrijgegeven")
Export="NEE"
End Select

If Export = "JA" Then
	iLogicVb.RunExternalRule("iLogic - make files")
End If

 (if need be i can also give the other rules)

0 Likes
978 Views
5 Replies
Replies (5)
Message 2 of 6

WCrihfield
Mentor
Mentor

Hi @Bram_Jessen.  Are you familiar with the iLogic Configuration settings?

https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=GUID-A65240D6-4854-42B9-B9A6-15453ACB5BC0 

If you are familiar with that, and already have directories listed in there for where to find all of your external rules, then there may be one other thing to keep in mind.  It will not automatically find external rules that are stored within sub folders of the folders listed in those settings.  So, if your external rule is in a sub folder of one of the folders listed, you will either need to include the name of that sub folder before the name of the external rule, or you will need to include that sub folder within those iLogic configuration settings.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 3 of 6

Bram_Jessen
Enthusiast
Enthusiast

Hello WCihflield,

Yes I was familiar with the setting, I found it when searching the forum.

When i added the direct folder yesterday instead of the subfolder it did't make a difference. Today however it seems to resolve the problem.

I'll check if the problem is still resolved tomorrow.

 

Sidenote: the settings and folders never changed, we never had problems with external rules in sub-folders until this week. So what causes the sudden problems in this situation?

0 Likes
Message 4 of 6

WCrihfield
Mentor
Mentor

Not sure, but one thing that happens to our team members where I work once in a while is, when we start Inventor, the 'default' project file will be active, instead of the custom one we normally use.  No idea why it happens.  Maybe when Inventor crashes, or maybe had to 'end task' it last time, because it froze up.  When that happens, several settings are different, including settings for where to find things, causing problems.  To fix it, we have to close all documents, but leave Inventor open, then go into the projects dialog and activate the correct one (one for each user, with their name in its file name).  That fixes the problems in those cases.

 

When I first started putting external rules into sub folders, I did not list the sub folders directly in the iLogic configuration settings, and I was experiencing what sounds like the same as you.  First time around some stuff not working, then working in following tries, like the needed information was being held in Inventor's session memory, or something like that.  Then I started adding the sub folder name followed by the "\" symbol, then the name of the external rule file in places where it needed to run external rules, which seemed to work OK for a while, but was cumbersome to keep up with when we have a pretty vast amount of them.  Then I added the sub folders directly into the iLogic configuration settings, which helped some.  However, all those places where I was specifying a sub folder directly in the iLogic rules, in front of the rule name, had to be changed back to just the rule name.  All was OK again after that.  Definitely learned that one the hard way.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 5 of 6

Bram_Jessen
Enthusiast
Enthusiast

Thank you for your reply, the problem with the projects (and settings) isn't happening here.

 

I've tried to set the directory of the ilogic rules directly as path in the settings, this works with the rules we had a problem with.

BUT this causes a new problem with the rules we didn't have a problem with, they are suddenly "not found".

 

So we ended up with 2 directory references in the Ilogic settings, one directly to the folder where the ilogic rules are stored, and one to a folder "one level higher" (like the situation how it always was).

This seems the solution for the Ilogic trouble we had.

 

In the back of my head this raises al sorts of alarm-bells, it seems to me that this is a situation like a ticking time-bomb...

But I don't see any other way of fixing this.

 

Any suggestions?

0 Likes
Message 6 of 6

WCrihfield
Mentor
Mentor

Hi @Bram_Jessen.  I actually created a post in the 'Inventor Ideas' forum about this situation.  I will post a link to it below, so that you and others might vote for it.  If it gets enough votes, then they may implement it into a future version or update of Inventor.

https://forums.autodesk.com/t5/inventor-ideas/external-ilogic-rule-directories-automatically-find-al... 

I never specified any entire paths, or file extensions, when using any of the 'RunRule' or 'RunExternalRule' type methods.  However, once I started getting a lot of folders (for different types / purposes of iLogic rules) I started making changes to the folder structure(s) where my iLogic rules were stored.  That's when I started having problems, because I did not fully understand how the 'look-up' system for finding / running external rules worked.  But apparently any external rule that is directly in a folder that is not specifically listed in those settings, will not be found initially.  In my 'idea', I want to be able to specify one main folder, where all external rules will be located under, even if their may be multiple levels of sub folders within it, then it will automatically find all external iLogic rules within that main directory, or any of its sub folders, any number of steps down.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)