<?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: Need help with ilogic File Save rule... in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/need-help-with-ilogic-file-save-rule/m-p/3805635#M131954</link>
    <description>&lt;P&gt;Hi Curtis,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry to HiJack this link&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I too am finding your code helpful, but is there a way to define the 'WorkSpacePath' ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to set it to a particualr folder within the workspace area.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Gareth&lt;/P&gt;</description>
    <pubDate>Fri, 15 Mar 2013 09:56:15 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2013-03-15T09:56:15Z</dc:date>
    <item>
      <title>Need help with ilogic File Save rule...</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/need-help-with-ilogic-file-save-rule/m-p/3797955#M131949</link>
      <description>&lt;P&gt;Hello, &amp;nbsp;can someone point out why this code does not work? &amp;nbsp;Strange thing is, it seems to have worked and saved my file the first time I ran it, but then will not work again. &amp;nbsp;SaveAs file dialog opens, I hit OK to save, and nothing happens. &amp;nbsp;No error, just nothing.&lt;/P&gt;&lt;P&gt;Code pasted below: I copied from an included snippet, and modified it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oFileDlg&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;inventor&lt;/SPAN&gt;.&lt;SPAN&gt;FileDialog&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; Nothing&lt;BR /&gt;&lt;SPAN&gt;InventorVb&lt;/SPAN&gt;.&lt;SPAN&gt;Application&lt;/SPAN&gt;.&lt;SPAN&gt;CreateFileDialog&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;oFileDlg&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;oFileDlg&lt;/SPAN&gt;.&lt;SPAN&gt;Filter&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;Inventor Files (*.iam;*.ipt)|*.iam;*.ipt|All Files (*.*)|*.*&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;oFileDlg.Filter = "XML Files (*.xml)|*.xml"&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;oFileDlg.Filter = "Excel Files (*.xls;*.xlsx)|*.xls;*.xlsx"&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;oFileDlg.Filter = "Text Files (*.txt;*.csv)|*.txt;*.csv"&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;oFileDlg.Filter = "SAT Files (*.sat)|*.sat"&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;oFileDlg.Filter = "IGES Files (*.igs)|*.igs"&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;oFileDlg.Filter = "Step Files (*.stp)|*.stp"&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;oFileDlg.DialogTitle = "Select a File"&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;oFileDlg.InitialDirectory = "C:\Vault Workspace\Projects\DSE Jobs\"  'ThisDoc.Path&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;oFileDlg&lt;/SPAN&gt;.&lt;SPAN&gt;FileName&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;C:\Vault Workspace\Projects\DSE Jobs\&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt; &lt;SPAN&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN&gt;Left&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;sJobNumber&lt;/SPAN&gt;,&lt;SPAN&gt;3&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt; &lt;SPAN&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;\&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt; &lt;SPAN&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN&gt;sJobNumber&lt;/SPAN&gt; &lt;SPAN&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;EXTERNAL\ASSEMBLY\&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt; &lt;SPAN&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN&gt;sJobNumber&lt;/SPAN&gt; &lt;SPAN&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt; &lt;SPAN&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN&gt;PartNumbers&lt;/SPAN&gt; &lt;SPAN&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;.ipt&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;  &lt;SPAN&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;ThisDoc.Path&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;oFileDlg&lt;/SPAN&gt;.&lt;SPAN&gt;CancelError&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; True&lt;BR /&gt;&lt;SPAN&gt;On&lt;/SPAN&gt; &lt;SPAN&gt;Error&lt;/SPAN&gt; &lt;SPAN&gt;Resume&lt;/SPAN&gt; &lt;SPAN&gt;Next&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;oFileDlg&lt;/SPAN&gt;.&lt;SPAN&gt;ShowSave&lt;/SPAN&gt;&lt;SPAN&gt;()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;If Err.Number &amp;lt;&amp;gt; 0 Then&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;MessageBox.Show("File not SAVED.", "Dialog Cancellation")&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;ElseIf oFileDlg.FileName &amp;lt;&amp;gt; "" Then&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;selectedfile = oFileDlg.FileName&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;MessageBox.Show("File " &amp;amp; selectedfile &amp;amp; " was selected.", "Dialog Selection Made")&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;End If&lt;/SPAN&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 Mar 2013 19:09:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/need-help-with-ilogic-file-save-rule/m-p/3797955#M131949</guid>
      <dc:creator>JamesNordgren</dc:creator>
      <dc:date>2013-03-06T19:09:05Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with ilogic File Save rule...</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/need-help-with-ilogic-file-save-rule/m-p/3798120#M131950</link>
      <description>&lt;P&gt;Hi JNORDGREN,&lt;/P&gt;&lt;P&gt;I think this line is generating an error:&lt;/P&gt;&lt;P&gt;oFileDlg.FileName = "C:\Vault Workspace\Projects\DSE Jobs\" &amp;amp; Left(sJobNumber,3) &amp;amp; "\" &amp;amp; sJobNumber &amp;amp; "EXTERNAL\ASSEMBLY\" &amp;amp; sJobNumber &amp;amp; "." &amp;amp; PartNumbers &amp;amp; ".ipt"&amp;nbsp; 'ThisDoc.Path&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;And the &lt;STRONG&gt;On Error Resume Next&lt;/STRONG&gt; is hiding it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Comment out On Error Resume Next and I think you'll see it.&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 target="_blank" href="http://inventortrenches.blogspot.com"&gt;http://inventortrenches.blogspot.com&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Mar 2013 21:28:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/need-help-with-ilogic-file-save-rule/m-p/3798120#M131950</guid>
      <dc:creator>Curtis_W</dc:creator>
      <dc:date>2013-03-06T21:28:29Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with ilogic File Save rule...</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/need-help-with-ilogic-file-save-rule/m-p/3798172#M131951</link>
      <description>&lt;P&gt;Thank you Curtis,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, it still doesnt work after commenting out the 'ON ERROR RESUME'.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have attached the rule in a file... any other ideas why it creates the dialog but does not save the file? &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Mar 2013 22:21:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/need-help-with-ilogic-file-save-rule/m-p/3798172#M131951</guid>
      <dc:creator>JamesNordgren</dc:creator>
      <dc:date>2013-03-06T22:21:09Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with ilogic File Save rule...</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/need-help-with-ilogic-file-save-rule/m-p/3798187#M131952</link>
      <description>&lt;P&gt;Hi JNORDGREN,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not sure you need the dialog box for what you're doing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you are just trying to save the file as a new file you might not need to create a dialog box, instead you can use something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;sName = iProperties.Value("Project", "Part Number") &amp;amp; "_Test.ipt"&lt;BR /&gt;sPath = "C:\Temp\"&lt;BR /&gt;&lt;BR /&gt;'Save File As &lt;BR /&gt;'True saves off a copy of this file as the new name&lt;BR /&gt;'False saves this file as the new name&lt;BR /&gt;ThisDoc.Document.SaveAs(sPath &amp;amp; sName , False)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you want the dialog box so that the user can browse for the location, you can use something like the example at this link:&lt;/P&gt;&lt;P&gt;&lt;A target="_blank" href="http://inventortrenches.blogspot.com/2012/10/ilogic-adding-save-as-dialog-box.html"&gt;http://inventortrenches.blogspot.com/2012/10/ilogic-adding-save-as-dialog-box.html&lt;/A&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 target="_blank" href="http://inventortrenches.blogspot.com"&gt;http://inventortrenches.blogspot.com&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Mar 2013 22:43:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/need-help-with-ilogic-file-save-rule/m-p/3798187#M131952</guid>
      <dc:creator>Curtis_W</dc:creator>
      <dc:date>2013-03-06T22:43:12Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with ilogic File Save rule...</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/need-help-with-ilogic-file-save-rule/m-p/3798986#M131953</link>
      <description>&lt;P&gt;Thanks!! &amp;nbsp;The link to your blog had exactly what I was missing.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Mar 2013 18:19:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/need-help-with-ilogic-file-save-rule/m-p/3798986#M131953</guid>
      <dc:creator>JamesNordgren</dc:creator>
      <dc:date>2013-03-07T18:19:11Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with ilogic File Save rule...</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/need-help-with-ilogic-file-save-rule/m-p/3805635#M131954</link>
      <description>&lt;P&gt;Hi Curtis,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry to HiJack this link&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I too am finding your code helpful, but is there a way to define the 'WorkSpacePath' ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to set it to a particualr folder within the workspace area.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Gareth&lt;/P&gt;</description>
      <pubDate>Fri, 15 Mar 2013 09:56:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/need-help-with-ilogic-file-save-rule/m-p/3805635#M131954</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-03-15T09:56:15Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with ilogic File Save rule...</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/need-help-with-ilogic-file-save-rule/m-p/4347138#M131955</link>
      <description>&lt;P&gt;The following code was written by me for the sole purpose saving an Inventor file so that the file Title begins the saved file name along with the Part Number something like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Framus (123456).i?? where&lt;/P&gt;&lt;P&gt;Title = Framus and Part Number = 123456&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code is also attempting to see if either field is blank.&amp;nbsp; If either Title or Part Number are blank, the code needs to allow the user to fill in the missing information.&amp;nbsp; I wish to use this code with any of the Inventor file types a user could create.&amp;nbsp; The current code doesn't work at the moment.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#993300"&gt;'Collect information to complete file naming convention when saving files&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#993300"&gt;'Define the active document&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#993300"&gt;oDoc = ThisDoc.Document&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#993300"&gt;'Look-up values for both the Title and Partnumber&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#993300"&gt;oTitle = iProperties.Value("Summary", "Title")&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#993300"&gt;oPartNumber = iProperties.Value("Project", "Part Number")&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#993300"&gt;'Test the Title to see if it's blank&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#993300"&gt;If oTitle = "" Then&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#993300"&gt;i = MessageBox.Show("Title info must be filled out before saving file!", "Title Information is missing", MessageBoxButtons.OK, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button1)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#993300"&gt;End If&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#993300"&gt;If oPartNumber = "" Then&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#993300"&gt;i = MessageBox.Show("Part Number must be filled out before saving file!", "Part Number is missing", MessageBoxButtons.OK, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button1)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#993300"&gt;End If&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;FONT color="#993300"&gt;'Show Form to allow entry of Title and PartNumber Information&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#993300"&gt;iLogicForm.Show("Title Information", FormMode.Modal)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#993300"&gt;'Set value of currrent file name&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#993300"&gt;oNewFileName =&amp;nbsp; iProperties.Value("Summary", "Title") &amp;amp; " " &amp;amp; "(" &amp;amp; iProperties.Value("Project", "Part Number") &amp;amp; ")"&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#993300"&gt;oDoc.SaveAs(oNewFileName, False) 'True = Save As Copy &amp;amp; False = Save As&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's my hope to write this rule as an External Rule so that it can be run at any time on any Inventor file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be appreciated!&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jul 2013 05:09:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/need-help-with-ilogic-file-save-rule/m-p/4347138#M131955</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-07-30T05:09:29Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with ilogic File Save rule...</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/need-help-with-ilogic-file-save-rule/m-p/4348399#M131956</link>
      <description>&lt;P&gt;Hi &amp;nbsp;JimStrenk.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This should work for you:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;'check for blank iProperty&lt;BR /&gt;If iProperties.Value("Summary", "Title") = "" Then&lt;BR /&gt;'prompt user for info if iProperty is blank&lt;BR /&gt;oTitle = InputBox("Title info must be filled out before saving file!", _&lt;BR /&gt;"iLogic - Title", iProperties.Value("Summary", "Title"))&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;'check for empty input &lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;'in case the user cancels out of the input box&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;If oTitle = "" Then&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Return 'end rule&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Else&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;End if&lt;BR /&gt;'write user input to the iProperty&lt;BR /&gt;iProperties.Value("Summary", "Title") = oTitle&lt;BR /&gt;End If&lt;BR /&gt;&lt;BR /&gt;'check for blank iProperty&lt;BR /&gt;If iProperties.Value("Project", "Part Number") = "" Then&lt;BR /&gt;'prompt user for info if iProperty is blank&lt;BR /&gt;oPartNumber = InputBox("Part Number must be filled out before saving file!", _&lt;BR /&gt;"iLogic - Part Number", iProperties.Value("Project", "Part Number"))&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;'check for empty input &lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;'in caset he user cancels out of the input box&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;If oPartNumber = "" Then&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Return 'end rule&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Else&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;End if&lt;BR /&gt;'write user input to the iProperty&lt;BR /&gt;iProperties.Value("Project", "Part Number") = oPartNumber&lt;BR /&gt;End If&lt;BR /&gt;&lt;BR /&gt;'Set value of currrent file name&lt;BR /&gt;oNewFileName =&amp;nbsp; iProperties.Value("Summary", "Title") _&lt;BR /&gt;&amp;amp; " " &amp;amp; "(" &amp;amp; iProperties.Value("Project", "Part Number") &amp;amp; ")"&lt;BR /&gt;&lt;BR /&gt;oDoc = ThisDoc.Document&lt;BR /&gt;'Save the file&lt;BR /&gt;'True = Save As Copy &lt;BR /&gt;'False = Save As&lt;BR /&gt;oDoc.SaveAs(oNewFileName, False) &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>Tue, 30 Jul 2013 14:54:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/need-help-with-ilogic-file-save-rule/m-p/4348399#M131956</guid>
      <dc:creator>Curtis_W</dc:creator>
      <dc:date>2013-07-30T14:54:11Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with ilogic File Save rule...</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/need-help-with-ilogic-file-save-rule/m-p/4349287#M131957</link>
      <description>&lt;P&gt;Curtis, close, very close.&amp;nbsp; The code is not working however.&amp;nbsp; Your code did allow me to input the Title and Part Number iProperties.&amp;nbsp; Once entered, the code fails.&amp;nbsp; These are the error messages that I get when running your code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ERROR MESSAGE:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Error in rule: iLogic File Namer, in document: Part1&lt;/P&gt;&lt;P&gt;The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;MORE INFO&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;System.ArgumentException: The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))&lt;/P&gt;&lt;P&gt;at Microsoft.VisualBasic.CompilerServices.LateBinding.InternalLateCall(Object o, Type objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack, Boolean IgnoreReturn)&lt;/P&gt;&lt;P&gt;at LmiRuleScript.Main()&lt;/P&gt;&lt;P&gt;at Autodesk.iLogic.Exec.AppDomExec.ExecRuleInAssembly(Assembly assem)&lt;/P&gt;&lt;P&gt;at iLogic.RuleEvalContainer.ExecRuleEval(String execRule)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My 'design intent' is to run this rule externally, be independent of Inventor file type, and also independent of whether Title and Part Number are filled or blank.&amp;nbsp; Code to work on currently opened file, and save the current file,&amp;nbsp;if possible.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's the code as entered in the iLogic Editor:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;'check for blank iProperty&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If iProperties.Value("Summary", "Title") = "" Then&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;'prompt user for info if iProperty is blank&lt;/P&gt;&lt;P&gt;oTitle = InputBox("Title info must be filled out before saving file!", _&lt;BR /&gt;"iLogic - Title", iProperties.Value("Summary", "Title"))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;'check for empty input&lt;BR /&gt;'in case the user cancels out of the Input box&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If oTitle = "" Then&lt;BR /&gt;Return 'end rule&lt;/P&gt;&lt;P&gt;Else&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;End If&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;'write user input to the iProperty&lt;/P&gt;&lt;P&gt;iProperties.Value("Summary", "Title") = oTitle&lt;BR /&gt;End If&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;'check for blank iProperty&lt;/P&gt;&lt;P&gt;If iProperties.Value("Project", "Part Number") = "" Then&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;'prompt user for info if iProperty is blank&lt;/P&gt;&lt;P&gt;oPartNumber = InputBox("Part Number must be filled out before saving file!", _&lt;BR /&gt;"iLogic - Part Number", iProperties.Value("Project", "Part Number"))&lt;/P&gt;&lt;P&gt;'check for empty input&lt;/P&gt;&lt;P&gt;'in case the user cancels out of the input box&lt;/P&gt;&lt;P&gt;If oPartNumber = "" Then&lt;/P&gt;&lt;P&gt;Return 'end rule&lt;BR /&gt;Else&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;End If&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;'write user input to the iProperty&lt;BR /&gt;iProperties.Value("Project", "Part Number") = oPartNumber&lt;/P&gt;&lt;P&gt;End If&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;'Set value of currrent file name&lt;BR /&gt;oNewFileName =&amp;nbsp; iProperties.Value("Summary", "Title") _&lt;BR /&gt;&amp;amp; " " &amp;amp; "(" &amp;amp; iProperties.Value("Project", "Part Number") &amp;amp; ")"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;oDoc = ThisDoc.Document&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;'Save the file 'True = Save As Copy 'False = Save As&lt;BR /&gt;oDoc.SaveAs(oNewFileName, False)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;'End of iLogic File Namer.iLogicVB Code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;System Specs.: Windows 7 Pro, PDSU 2014, Vault Basic 2014 Client, Vault Basic 2014Server&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;BTW, I've enjoyed purchasing and&amp;nbsp;reading all of your Master Autodesk Inventor Series.&amp;nbsp; I'm sorry to report I was late in purchasing the 2014 Edition (July 2, 2013).&amp;nbsp; I enjoyed the reading more than the purchasing.&amp;nbsp; Tee hee!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How did you and the other major iLogic contributors learn this stuff?&amp;nbsp; While your books do a good job of discussing&amp;nbsp;the&amp;nbsp;basics if iLogic, are there other sources you&amp;nbsp;or other might recommend regarding writing iLogic code?&amp;nbsp; If you had the time, I'd ask that you author "The iLogic Bible".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I highly recommend your web site for more information about using iLogic.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Again, thank you for your assistance in helping me with the iLogic&amp;nbsp;code.&amp;nbsp; It is appreciated!&amp;nbsp; &lt;img id="smileyvery-happy" class="emoticon emoticon-smileyvery-happy" src="https://forums.autodesk.com/i/smilies/16x16_smiley-very-happy.png" alt="Smiley Very Happy" title="Smiley Very Happy" /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;!-- EndFragment --&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jul 2013 06:31:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/need-help-with-ilogic-file-save-rule/m-p/4349287#M131957</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-07-31T06:31:00Z</dc:date>
    </item>
  </channel>
</rss>

