• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Discussion Groups

    Autodesk Inventor

    Reply
    Valued Contributor
    zdhrichard
    Posts: 100
    Registered: ‎05-03-2011
    Accepted Solution

    Ilogic Rule (in 2009) cannot run in 2013 Inventor

    271 Views, 6 Replies
    09-18-2012 10:37 AM

    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?

     

    Richard Z.

    Autodesk Inventor Professional 2013 (64 Bit) SP1.1
    Windows 7 Professional Service Pack 1
    Intel(R) Xeon(R) CPU E5645
    12.0 GB Memory
    Please use plain text.
    *Expert Elite*
    mrattray
    Posts: 1,485
    Registered: ‎09-13-2011

    Re: Ilogic Rule (in 2009) cannot run in 2013 Inventor

    09-18-2012 01:31 PM 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

    Please use plain text.
    Valued Contributor
    zdhrichard
    Posts: 100
    Registered: ‎05-03-2011

    Re: Ilogic Rule (in 2009) cannot run in 2013 Inventor

    09-19-2012 08:20 AM 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.

    Richard Z.

    Autodesk Inventor Professional 2013 (64 Bit) SP1.1
    Windows 7 Professional Service Pack 1
    Intel(R) Xeon(R) CPU E5645
    12.0 GB Memory
    Please use plain text.
    *Expert Elite*
    mrattray
    Posts: 1,485
    Registered: ‎09-13-2011

    Re: Ilogic Rule (in 2009) cannot run in 2013 Inventor

    09-19-2012 08:29 AM 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

    Please use plain text.
    Valued Contributor
    zdhrichard
    Posts: 100
    Registered: ‎05-03-2011

    Re: Ilogic Rule (in 2009) cannot run in 2013 Inventor

    09-19-2012 08:48 AM 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?
    Richard Z.

    Autodesk Inventor Professional 2013 (64 Bit) SP1.1
    Windows 7 Professional Service Pack 1
    Intel(R) Xeon(R) CPU E5645
    12.0 GB Memory
    Please use plain text.
    *Expert Elite*
    mrattray
    Posts: 1,485
    Registered: ‎09-13-2011

    Re: Ilogic Rule (in 2009) cannot run in 2013 Inventor

    09-19-2012 09:09 AM 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

    Please use plain text.
    Valued Contributor
    zdhrichard
    Posts: 100
    Registered: ‎05-03-2011

    Re: Ilogic Rule (in 2009) cannot run in 2013 Inventor

    09-19-2012 10:19 AM 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.

     

    Richard Z.

    Autodesk Inventor Professional 2013 (64 Bit) SP1.1
    Windows 7 Professional Service Pack 1
    Intel(R) Xeon(R) CPU E5645
    12.0 GB Memory
    Please use plain text.