<?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: Custom File naming syntax (beginner!) help in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/custom-file-naming-syntax-beginner-help/m-p/11087973#M136389</link>
    <description>&lt;P&gt;ThisDoc.FileName is a read-only property, you can't set it from code. If you are creating a drawing from scratch then you need to make your filename first as a string and have Inventor create the drawing for you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The correct syntax to create the filename would look something like this:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Dim filename = iProperties.Value("Project", "Part Number") &amp;amp; "-" &amp;amp; iProperties.Value("Project", "Description") &amp;amp; ".idw"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To create a new drawing you use the ThisApplication object.&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Dim drawing as DrawingDocument = ThisApplication.Documents.Add(kDrawingDocumentObject)

drawing.SaveAs(filename, False) &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 06 Apr 2022 16:07:06 GMT</pubDate>
    <dc:creator>Zach.Stauffer</dc:creator>
    <dc:date>2022-04-06T16:07:06Z</dc:date>
    <item>
      <title>Custom File naming syntax (beginner!) help</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/custom-file-naming-syntax-beginner-help/m-p/11087468#M136376</link>
      <description>&lt;P&gt;Hi everyone, I am a beginner to ilogic and have thus far only copy and pasted code from others.&amp;nbsp; I'm trying to write my own code to perform the following function: I would like a default filename scheme for drawings as "partnumber"-"description".idw.&amp;nbsp; upon the first save.&amp;nbsp; Example 1234-1234-Bottom Bracket.idw&lt;/P&gt;&lt;P&gt;Here is what my code looks like, if anyone can provide guidance I would be much appreciated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;"ThisDoc.FileName(False) 'without extension"&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;"Part Number"&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;"Description"&lt;/SPAN&gt;))&lt;/PRE&gt;&lt;P&gt;I am very excited to be getting into this, I've wanted to branch out into ilogic for some time now but but time hasn't allowed it.&amp;nbsp; Many many thanks!!&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;</description>
      <pubDate>Wed, 06 Apr 2022 13:26:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/custom-file-naming-syntax-beginner-help/m-p/11087468#M136376</guid>
      <dc:creator>paulZKN98</dc:creator>
      <dc:date>2022-04-06T13:26:07Z</dc:date>
    </item>
    <item>
      <title>Re: Custom File naming syntax (beginner!) help</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/custom-file-naming-syntax-beginner-help/m-p/11087973#M136389</link>
      <description>&lt;P&gt;ThisDoc.FileName is a read-only property, you can't set it from code. If you are creating a drawing from scratch then you need to make your filename first as a string and have Inventor create the drawing for you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The correct syntax to create the filename would look something like this:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Dim filename = iProperties.Value("Project", "Part Number") &amp;amp; "-" &amp;amp; iProperties.Value("Project", "Description") &amp;amp; ".idw"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To create a new drawing you use the ThisApplication object.&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Dim drawing as DrawingDocument = ThisApplication.Documents.Add(kDrawingDocumentObject)

drawing.SaveAs(filename, False) &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Apr 2022 16:07:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/custom-file-naming-syntax-beginner-help/m-p/11087973#M136389</guid>
      <dc:creator>Zach.Stauffer</dc:creator>
      <dc:date>2022-04-06T16:07:06Z</dc:date>
    </item>
    <item>
      <title>Re: Custom File naming syntax (beginner!) help</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/custom-file-naming-syntax-beginner-help/m-p/11087999#M136390</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ilogic uses VB.Net, what you are trying to do is called contatenation. It the process of combining several strings into one.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;VB.Net uses "&amp;amp;" as its concatenation operator:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;filename = iProperties&lt;/SPAN&gt;.&lt;SPAN&gt;Value&lt;/SPAN&gt;(&lt;SPAN&gt;"Project"&lt;/SPAN&gt;, &lt;SPAN&gt;"Part Number"&lt;/SPAN&gt;) &amp;amp; " - " &amp;amp; &lt;SPAN&gt;iProperties&lt;/SPAN&gt;.&lt;SPAN&gt;Value&lt;/SPAN&gt;(&lt;SPAN&gt;"Project"&lt;/SPAN&gt;, &lt;SPAN&gt;"Description"&lt;/SPAN&gt;)&lt;/PRE&gt;&lt;P&gt;Also, You cannot change a file name on the fly. It's only upon creating it that you can set its name. If it was possible, we would need a way to update every files that refers to this filename.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Apr 2022 16:13:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/custom-file-naming-syntax-beginner-help/m-p/11087999#M136390</guid>
      <dc:creator>yan.gauthier</dc:creator>
      <dc:date>2022-04-06T16:13:55Z</dc:date>
    </item>
  </channel>
</rss>

