Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Ilogic Rule (in 2009) cannot run in 2013 Inventor

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
zdhrichard
716 Views, 6 Replies

Ilogic Rule (in 2009) cannot run in 2013 Inventor

Finally, we updated to 2013 Inventor Professional (64 bit).

 

Now I have some problems when I run the rule  which I created in 2009 (32 bit).

 

First one is:

 

I created a rule which is suppressed. I need run it when I save files. The problem is: after I moved to 2013, and when I puch SAVE button, my rule cannot be run.

 

Does anyone how to solve this problem?

 

Rich

Autodesk Inventor Professional 2018 (64 Bit Edition)
Build: 284, Release 2018.3
Windows 7 Professional Service Pack 1
Intel(R) Xeon(R) CPU E5645
12.0 GB Memory
6 REPLIES 6
Message 2 of 7
mrattray
in reply to: zdhrichard

Are you receiving an error message? Can you post it?

What is the rule you're trying to run?

Mike (not Matt) Rattray

Message 3 of 7
zdhrichard
in reply to: mrattray

Hello Mike,

Thanks lot for your reply.

Unfortunately, I cannot post my model in. But I am copying the picture and my code as following.

 

SubMain()DimoutputfileAsStringDimmyFileNameAsStringDimmyOriginalManifoldAsStringDimmyReplaceManifoldAsStringmyFileName=ModelPartNumberoQuestion=MessageBox.Show("Do you want to save "&myFileName&"-E.ipt and "&myFileName&".iam at same time?", "Save", MessageBoxButtons.YesNo)IfoQuestion=vbYesTheniLogicVb.RunRule("Manifold", "Save File")myOriginalManifold=ThisDoc.PathAndFileName(False)&"-E.ipt"' without extension'MessageBox.Show("My Original Manifold file is " & myOriginalManifold, "Message")myReplaceManifold=ThisDoc.Path&"\"&myFileName&"-E.ipt"'MessageBox.Show("My Replace Manifold file is " & myReplaceManifold, "Message")outputfile=ThisDoc.Path&"\"&myFileName&".iam"Component.Replace("Manifold", myReplaceManifold, True)ThisDoc.Document.SaveAs(outputfile, True)Component.Replace("Manifold", myOriginalManifold, True)EndIfEnd Sub

I could run above code correctly if I seperately run it. But now I just want when I push "Save" button, the rule will be run.

 

If you could help to find it out, it will be much appreciated.

Rich

Autodesk Inventor Professional 2018 (64 Bit Edition)
Build: 284, Release 2018.3
Windows 7 Professional Service Pack 1
Intel(R) Xeon(R) CPU E5645
12.0 GB Memory
Message 4 of 7
mrattray
in reply to: zdhrichard

Oh, I see what your problem is. The rule wont trigger because it's suppressed. You have to unsuppress the rule in order for it to run when you save.

I assume you have it suppressed because you don't want it to randomly fire while your trying to draw. It shouldn't ever fire, bar on your triggered save event, unless a parameter that is referenced inside of the rule is changed. So, in your case, as long as the ModelPartNumber parameter doesn't get changed, you'll get the behaviour you expect. If you need to be able to change this parameter without triggering the rule, then I would filter the part number through an iProperty. That way you can change the paameter all day without triggering the rule, but still be able to reference it inside of the rule.

I hope all that made sense.

Mike (not Matt) Rattray

Message 5 of 7
zdhrichard
in reply to: mrattray

Thanks lot for your suggestion. This way worked fine when I used 2009 Inventor. For your suggestion, maybe I did not understand well. The problem is: any of parameter is changed, "ModelPartNumber" and "part Number" in iProperty will be changed at same time by other rule. Do you know any other way no matter what I changed, the rule will be not trigged unless I push the "Save" button?
Rich

Autodesk Inventor Professional 2018 (64 Bit Edition)
Build: 284, Release 2018.3
Windows 7 Professional Service Pack 1
Intel(R) Xeon(R) CPU E5645
12.0 GB Memory
Message 6 of 7
mrattray
in reply to: zdhrichard

In the rule you posted above, change where you reference the ModelPartNumber parameter to instead reference the Part Number iProperty.  This will stop the save rule from running on a change of part number, because properties can not trigger rules. Then unsuppress the save rule.

If you do this, then the only way that the rule will run is if you save the file, or you RMB on the rule in the iLogic browser and click run.

Mike (not Matt) Rattray

Message 7 of 7
zdhrichard
in reply to: mrattray

Got! Thanks lot.

It is working now.

And I need change to after Saving to rule the rule. Otherwise, Inventor give me "File Copy Error on Save" which is said "The system cannot find the path specified." when save the original file.

 

Rich

Autodesk Inventor Professional 2018 (64 Bit Edition)
Build: 284, Release 2018.3
Windows 7 Professional Service Pack 1
Intel(R) Xeon(R) CPU E5645
12.0 GB Memory

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report