<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Running a iLogic rule once. in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/running-a-ilogic-rule-once/m-p/12017477#M38503</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/13325850"&gt;@rmostertRGQ8T&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;i want them to get a form when they save to give imput of the assembly name, author and revision data when change an existing assembly. This information is stored in the iProperties and also used in the drawing when that is created.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;for your needs you could just do something like this, to check for empty values, and only show the form if one or more of the properties is empty.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;iProperties&lt;/SPAN&gt;.&lt;SPAN&gt;Value&lt;/SPAN&gt;(&lt;SPAN&gt;"Summary"&lt;/SPAN&gt;, &lt;SPAN&gt;"Title"&lt;/SPAN&gt;) = &lt;SPAN&gt;""&lt;/SPAN&gt; &lt;SPAN&gt;Or&lt;/SPAN&gt; _
	&lt;SPAN&gt;iProperties&lt;/SPAN&gt;.&lt;SPAN&gt;Value&lt;/SPAN&gt;(&lt;SPAN&gt;"Project"&lt;/SPAN&gt;, &lt;SPAN&gt;"Revision Number"&lt;/SPAN&gt;) = &lt;SPAN&gt;""&lt;/SPAN&gt; &lt;SPAN&gt;Or&lt;/SPAN&gt; _
	&lt;SPAN&gt;iProperties&lt;/SPAN&gt;.&lt;SPAN&gt;Value&lt;/SPAN&gt;(&lt;SPAN&gt;"Summary"&lt;/SPAN&gt;, &lt;SPAN&gt;"Author"&lt;/SPAN&gt;) = &lt;SPAN&gt;""&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt;
	&lt;SPAN&gt;iLogicForm&lt;/SPAN&gt;.&lt;SPAN&gt;Show&lt;/SPAN&gt;(&lt;SPAN&gt;"File Info Form"&lt;/SPAN&gt;)
&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;I hope this helps.&lt;BR /&gt;Best of luck to you in all of your Inventor pursuits,&lt;BR /&gt;Curtis&lt;BR /&gt;&lt;A href="http://inventortrenches.blogspot.com" target="_blank"&gt;http://inventortrenches.blogspot.com&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 07 Jun 2023 13:58:40 GMT</pubDate>
    <dc:creator>Curtis_W</dc:creator>
    <dc:date>2023-06-07T13:58:40Z</dc:date>
    <item>
      <title>Running a iLogic rule once.</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/running-a-ilogic-rule-once/m-p/11097925#M38495</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I have a i-Logic rule that when run a forum pops up that promps the users to fill in some infomation about the part.&lt;/P&gt;&lt;P&gt;I would like the form to pop up when the user saves however I only need it to display once rather than every single time they save.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone know if this can be achieved?&amp;nbsp;&lt;/P&gt;&lt;P&gt;and then subsequently how?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If feel like everything is there but I just cant get my mind around how to do it.&lt;/P&gt;&lt;P&gt;I'm using inventor 2020 and have little to no experience with VBA(maybe a good opportunity to learn a little).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be great.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;Luke.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Apr 2022 10:25:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/running-a-ilogic-rule-once/m-p/11097925#M38495</guid>
      <dc:creator>luke.scottWYFAG</dc:creator>
      <dc:date>2022-04-11T10:25:05Z</dc:date>
    </item>
    <item>
      <title>Re: Running a iLogic rule once.</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/running-a-ilogic-rule-once/m-p/11098060#M38496</link>
      <description>&lt;P&gt;Your iLogic rule that launches the Form, can check how many times the current file has been saved first, and if more than once, can exit the rule without continuing any further.&amp;nbsp; You could have a line of code like this as the first line of code in the rule:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;If ThisDoc.Document.FileSaveCounter &amp;gt; 1 Then Exit Sub 'or Return&lt;/LI-CODE&gt;
&lt;P&gt;You can adjust the counter as needed, but if this is triggered to run at the 'Before Save' event, then the first time this gets triggered to run, the file will not have been saved for the first time yet.&amp;nbsp; After that, it should be at least 1.&amp;nbsp; Also, it is a little confusing which version of code you needed the solution in.&amp;nbsp; Because you mentioned both iLogic, and VBA in your first post, and they are both different.&amp;nbsp; The code I posted will work within an iLogic rule, but not in a VBA macro, because it uses the 'ThisDoc' term, which is iLogic only.&amp;nbsp; If you need to use a similar line of code within a VBA macro, you could use 'ThisApplication.ActiveDocument' instead of 'ThisDoc.Document'.&amp;nbsp; There is no guarantee that they will both return the same document in every situation though.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Apr 2022 11:30:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/running-a-ilogic-rule-once/m-p/11098060#M38496</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2022-04-11T11:30:00Z</dc:date>
    </item>
    <item>
      <title>Re: Running a iLogic rule once.</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/running-a-ilogic-rule-once/m-p/11098071#M38497</link>
      <description>&lt;P&gt;Brilliant, that you so much for the help, that works like an absolute charm.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Apr 2022 11:25:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/running-a-ilogic-rule-once/m-p/11098071#M38497</guid>
      <dc:creator>luke.scottWYFAG</dc:creator>
      <dc:date>2022-04-11T11:25:44Z</dc:date>
    </item>
    <item>
      <title>Re: Running a iLogic rule once.</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/running-a-ilogic-rule-once/m-p/12017232#M38498</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;BR /&gt;I found this post here and i have a question about the "&lt;SPAN&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN&gt;Document&lt;/SPAN&gt;.&lt;SPAN&gt;FileSaveCounter&lt;/SPAN&gt;".&lt;BR /&gt;I run the rule below which i trigger before save to open a form that needs to be filled in. When clicking done on the form the document is saved again so the date filled in is saved. At that save i don't need to trigger the form again so i use a custom property to skip the Form.Show.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;My question/problem i encounter is that the&amp;nbsp;&lt;SPAN&gt;FileSaveCounter keeps counting up, even after closing and open the document. So it will not put the custom property on True when you save the first time after you opened the document.&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;Sub&lt;/SPAN&gt; &lt;SPAN&gt;Main&lt;/SPAN&gt;
	&lt;SPAN&gt;'Skip the form when saved automaticly via form&lt;/SPAN&gt;
		&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN&gt;Document&lt;/SPAN&gt;.&lt;SPAN&gt;FileSaveCounter&lt;/SPAN&gt; &amp;lt; 1 &lt;SPAN&gt;Then&lt;/SPAN&gt; &lt;SPAN&gt;iProperties&lt;/SPAN&gt;.&lt;SPAN&gt;Value&lt;/SPAN&gt;(&lt;SPAN&gt;"Custom"&lt;/SPAN&gt;, &lt;SPAN&gt;"SaveDocument"&lt;/SPAN&gt;) = &lt;SPAN&gt;"True"&lt;/SPAN&gt;
		&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;iProperties&lt;/SPAN&gt;.&lt;SPAN&gt;Value&lt;/SPAN&gt;(&lt;SPAN&gt;"Custom"&lt;/SPAN&gt;, &lt;SPAN&gt;"SaveDocument"&lt;/SPAN&gt;) = &lt;SPAN&gt;"False"&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt; &lt;SPAN&gt;Exit&lt;/SPAN&gt; &lt;SPAN&gt;Sub&lt;/SPAN&gt;

	&lt;SPAN&gt;'Show Form&lt;/SPAN&gt;
		&lt;SPAN&gt;iLogicForm&lt;/SPAN&gt;.&lt;SPAN&gt;Show&lt;/SPAN&gt;(&lt;SPAN&gt;"Drawing Data"&lt;/SPAN&gt;)

&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;Sub&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jun 2023 12:44:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/running-a-ilogic-rule-once/m-p/12017232#M38498</guid>
      <dc:creator>rmostertRGQ8T</dc:creator>
      <dc:date>2023-06-07T12:44:29Z</dc:date>
    </item>
    <item>
      <title>Re: Running a iLogic rule once.</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/running-a-ilogic-rule-once/m-p/12017378#M38499</link>
      <description>&lt;P&gt;Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/13325850"&gt;@rmostertRGQ8T&lt;/a&gt;.&amp;nbsp; I am not sure I understand what you are trying to achieve here.&amp;nbsp; The &lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=Document_FileSaveCounter" target="_blank" rel="noopener"&gt;Document.FileSaveCounter&lt;/A&gt; property is ReadOnly, so it will only ever change in the positive direction every time the file gets saved.&amp;nbsp; Do you need that form to be shown more than just the one initial time (before the file is saved for the first time)?&amp;nbsp; What is the form being used for?&amp;nbsp; What 'mode' is your iLogic form set to (Modal or non Modal)?&amp;nbsp; If it is designed to be Modal, or if you include the additional instruction in your code to show the form as Modal, the iLogic rule will be essentially 'paused' while that form is open, then will resume after the form is closed.&amp;nbsp; If you need to run additional code after the form has closed, you could take advantage of that behavior, if you needed to.&amp;nbsp; Otherwise the file will simply continue to save, because you have interupted the save process with this rule, so it will now resume the save.&lt;/P&gt;
&lt;P&gt;Edit:&amp;nbsp; If the form is not designed as Modal, and not shown as Modal, the form may get shown, but the document may go ahead and save before you get done with the form...I am not 100% sure about that timing.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jun 2023 13:33:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/running-a-ilogic-rule-once/m-p/12017378#M38499</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2023-06-07T13:33:53Z</dc:date>
    </item>
    <item>
      <title>Re: Running a iLogic rule once.</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/running-a-ilogic-rule-once/m-p/12017427#M38500</link>
      <description>&lt;P&gt;I will try to explain what i want in short and clear text:&lt;/P&gt;&lt;P&gt;When users make a Factory design Suit assembly, i want them to get a form when they save to give imput of the assembly name, author and revision data when change an existing assembly. This information is stored in the iProperties and also used in the drawing when that is created.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So i made a rule, that shows the Form, which is triggered 'before save'. But i noticed the document is saved before the user filled in the info in the form. And when i made the form done butun to save, you'll trigger the form again.&lt;/P&gt;&lt;P&gt;I have a workaround that the rule that shows up the form is skipping it's content when triggered by the form buton and not show the form. I do this via a custom property which is false or true.&amp;nbsp;&lt;/P&gt;&lt;P&gt;When you click the save buton in the form, the property is set to false and the document will save, and afterwards the property is set to true.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Since the property was set to true after the saving, when close the document withouth saving, and the document is opened again, the property will be false and the form will never show up.&lt;/P&gt;&lt;P&gt;With the savecounter i hoped to archieve "If ThisDoc.Document.FileSaveCounter &amp;lt; 1 Then Property = True".&lt;/P&gt;&lt;P&gt;But since the SaveCounter doens't start at 0 when you opened an existing document, it only starts at 0 with a new document, so it doesn't work for me.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jun 2023 13:45:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/running-a-ilogic-rule-once/m-p/12017427#M38500</guid>
      <dc:creator>rmostertRGQ8T</dc:creator>
      <dc:date>2023-06-07T13:45:59Z</dc:date>
    </item>
    <item>
      <title>Re: Running a iLogic rule once.</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/running-a-ilogic-rule-once/m-p/12017448#M38501</link>
      <description>&lt;P&gt;edit: I missed the last reply with the explanation, before I replied&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRIKE&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/13325850"&gt;@rmostertRGQ8T&lt;/a&gt;,&lt;/STRIKE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRIKE&gt;Is your file being saved as a template file, from which a new file is created?&lt;/STRIKE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRIKE&gt;If yes, then the file save counter should be reset to zero when a new file is created from that template.&lt;/STRIKE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRIKE&gt;If no, and you are just using a saved file from disk, then the file save counter will start at some number other than zero and this method is not likely to provide a solution.&lt;/STRIKE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this helps.&lt;BR /&gt;Best of luck to you in all of your Inventor pursuits,&lt;BR /&gt;Curtis&lt;BR /&gt;&lt;A href="http://inventortrenches.blogspot.com" target="_blank" rel="noopener"&gt;http://inventortrenches.blogspot.com&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jun 2023 13:53:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/running-a-ilogic-rule-once/m-p/12017448#M38501</guid>
      <dc:creator>Curtis_W</dc:creator>
      <dc:date>2023-06-07T13:53:32Z</dc:date>
    </item>
    <item>
      <title>Re: Running a iLogic rule once.</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/running-a-ilogic-rule-once/m-p/12017466#M38502</link>
      <description>&lt;P&gt;Thanks for your reply,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It will start as a template indeed. But is has to work when making a revision of an existing assembly to. So it wouldn't work in the later situation.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have made a new rule that sets that property to true and trigger that rule on document opening. It seems to work but i didn't have it work 100% of the times. It is also 'Ugly' to have another rule with just one sentence...&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jun 2023 13:55:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/running-a-ilogic-rule-once/m-p/12017466#M38502</guid>
      <dc:creator>rmostertRGQ8T</dc:creator>
      <dc:date>2023-06-07T13:55:47Z</dc:date>
    </item>
    <item>
      <title>Re: Running a iLogic rule once.</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/running-a-ilogic-rule-once/m-p/12017477#M38503</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/13325850"&gt;@rmostertRGQ8T&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;i want them to get a form when they save to give imput of the assembly name, author and revision data when change an existing assembly. This information is stored in the iProperties and also used in the drawing when that is created.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;for your needs you could just do something like this, to check for empty values, and only show the form if one or more of the properties is empty.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;iProperties&lt;/SPAN&gt;.&lt;SPAN&gt;Value&lt;/SPAN&gt;(&lt;SPAN&gt;"Summary"&lt;/SPAN&gt;, &lt;SPAN&gt;"Title"&lt;/SPAN&gt;) = &lt;SPAN&gt;""&lt;/SPAN&gt; &lt;SPAN&gt;Or&lt;/SPAN&gt; _
	&lt;SPAN&gt;iProperties&lt;/SPAN&gt;.&lt;SPAN&gt;Value&lt;/SPAN&gt;(&lt;SPAN&gt;"Project"&lt;/SPAN&gt;, &lt;SPAN&gt;"Revision Number"&lt;/SPAN&gt;) = &lt;SPAN&gt;""&lt;/SPAN&gt; &lt;SPAN&gt;Or&lt;/SPAN&gt; _
	&lt;SPAN&gt;iProperties&lt;/SPAN&gt;.&lt;SPAN&gt;Value&lt;/SPAN&gt;(&lt;SPAN&gt;"Summary"&lt;/SPAN&gt;, &lt;SPAN&gt;"Author"&lt;/SPAN&gt;) = &lt;SPAN&gt;""&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt;
	&lt;SPAN&gt;iLogicForm&lt;/SPAN&gt;.&lt;SPAN&gt;Show&lt;/SPAN&gt;(&lt;SPAN&gt;"File Info Form"&lt;/SPAN&gt;)
&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;I hope this helps.&lt;BR /&gt;Best of luck to you in all of your Inventor pursuits,&lt;BR /&gt;Curtis&lt;BR /&gt;&lt;A href="http://inventortrenches.blogspot.com" target="_blank"&gt;http://inventortrenches.blogspot.com&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jun 2023 13:58:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/running-a-ilogic-rule-once/m-p/12017477#M38503</guid>
      <dc:creator>Curtis_W</dc:creator>
      <dc:date>2023-06-07T13:58:40Z</dc:date>
    </item>
    <item>
      <title>Re: Running a iLogic rule once.</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/running-a-ilogic-rule-once/m-p/12017535#M38504</link>
      <description>&lt;P&gt;I looked into this quote&amp;nbsp;&lt;/P&gt;&lt;P&gt;"&lt;SPAN&gt;What 'mode' is your iLogic form set to (Modal or non Modal)?&amp;nbsp; If it is designed to be Modal, or if you include the additional instruction in your code to show the form as Modal, the iLogic rule will be essentially 'paused' while that form is open, then will resume after the form is closed.&amp;nbsp;&lt;/SPAN&gt;"&lt;/P&gt;&lt;P&gt;I didn't know what Modal was/meant but sounded promesing. I made a copy and tryed it out and works perfect! Now i can let the user fill in the form, while the rule, that was triggered and shows the form, is waiting for the form to be closed. Which after the document is saved.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you kind strangers ^.^ !&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jun 2023 14:11:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/running-a-ilogic-rule-once/m-p/12017535#M38504</guid>
      <dc:creator>rmostertRGQ8T</dc:creator>
      <dc:date>2023-06-07T14:11:55Z</dc:date>
    </item>
  </channel>
</rss>

