<?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: iLogic, save .idw sheet as PDF in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-save-idw-sheet-as-pdf/m-p/8864742#M98629</link>
    <description>&lt;P&gt;@Anonymous&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try this,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;DirectoryPath = Strings.Right(PathOnly, Len(PathOnly) - WorkspacePathLength)&lt;/PRE&gt;
&lt;P&gt;Thanks and regards,&lt;/P&gt;</description>
    <pubDate>Fri, 21 Jun 2019 10:56:33 GMT</pubDate>
    <dc:creator>chandra.shekar.g</dc:creator>
    <dc:date>2019-06-21T10:56:33Z</dc:date>
    <item>
      <title>iLogic, save .idw sheet as PDF</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-save-idw-sheet-as-pdf/m-p/8864649#M98626</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;We have this small code running in Inventor which auto saves a PDF copy of&amp;nbsp;all .idw files when we save them.&lt;/P&gt;&lt;P&gt;But something is wrong and it comes with an Error message&lt;/P&gt;&lt;P&gt;“Argument ”Length” has to be equal or lager then 0”&lt;/P&gt;&lt;P&gt;Code looks like this&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;WorkspacePath&lt;/SPAN&gt; = &lt;SPAN&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN&gt;WorkspacePath&lt;/SPAN&gt;()

&lt;SPAN&gt;WorkspacePathLength&lt;/SPAN&gt; = &lt;SPAN&gt;Len&lt;/SPAN&gt;(&lt;SPAN&gt;WorkspacePath&lt;/SPAN&gt;)

&lt;SPAN&gt;PathOnly&lt;/SPAN&gt; = &lt;SPAN&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN&gt;Path&lt;/SPAN&gt;

&lt;SPAN&gt;DirectoryPath&lt;/SPAN&gt; = &lt;SPAN&gt;Strings&lt;/SPAN&gt;.&lt;SPAN&gt;Right&lt;/SPAN&gt;(&lt;SPAN&gt;PathOnly&lt;/SPAN&gt;, &lt;SPAN&gt;PathOnly&lt;/SPAN&gt;.&lt;SPAN&gt;Length&lt;/SPAN&gt;-&lt;SPAN&gt;WorkspacePathLength&lt;/SPAN&gt;)

&lt;SPAN&gt;PDFPath&lt;/SPAN&gt; = &lt;SPAN&gt;"\\sbs 2011\files\Z\Tegninger PDF"&lt;/SPAN&gt;

&lt;SPAN&gt;If&lt;/SPAN&gt;(&lt;SPAN&gt;Not&lt;/SPAN&gt; &lt;SPAN&gt;System&lt;/SPAN&gt;.&lt;SPAN&gt;IO&lt;/SPAN&gt;.&lt;SPAN&gt;Directory&lt;/SPAN&gt;.&lt;SPAN&gt;Exists&lt;/SPAN&gt;(&lt;SPAN&gt;PDFPath&lt;/SPAN&gt;)) &lt;SPAN&gt;Then&lt;/SPAN&gt;
    &lt;SPAN&gt;System&lt;/SPAN&gt;.&lt;SPAN&gt;IO&lt;/SPAN&gt;.&lt;SPAN&gt;Directory&lt;/SPAN&gt;.&lt;SPAN&gt;CreateDirectory&lt;/SPAN&gt;(&lt;SPAN&gt;PDFPath&lt;/SPAN&gt;)
&lt;SPAN&gt;End&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;SaveAs&lt;/SPAN&gt;(&lt;SPAN&gt;PDFPath&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;"\"&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN&gt;FileName&lt;/SPAN&gt;(&lt;SPAN&gt;False&lt;/SPAN&gt;) &amp;amp; &lt;SPAN&gt;".pdf"&lt;/SPAN&gt; , &lt;SPAN&gt;True&lt;/SPAN&gt;)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jun 2019 10:11:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-save-idw-sheet-as-pdf/m-p/8864649#M98626</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-06-21T10:11:49Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic, save .idw sheet as PDF</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-save-idw-sheet-as-pdf/m-p/8864742#M98629</link>
      <description>&lt;P&gt;@Anonymous&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try this,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;DirectoryPath = Strings.Right(PathOnly, Len(PathOnly) - WorkspacePathLength)&lt;/PRE&gt;
&lt;P&gt;Thanks and regards,&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jun 2019 10:56:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-save-idw-sheet-as-pdf/m-p/8864742#M98629</guid>
      <dc:creator>chandra.shekar.g</dc:creator>
      <dc:date>2019-06-21T10:56:33Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic, save .idw sheet as PDF</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-save-idw-sheet-as-pdf/m-p/8864781#M98630</link>
      <description>&lt;P&gt;This changes nothing.. Still same Error message&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jun 2019 11:19:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-save-idw-sheet-as-pdf/m-p/8864781#M98630</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-06-21T11:19:47Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic, save .idw sheet as PDF</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-save-idw-sheet-as-pdf/m-p/8864799#M98631</link>
      <description>&lt;P&gt;@Anonymous&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try this. Can you please provide sample path of WorkspacePath and ThisDoc.Path.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;WorkspacePath = ThisDoc.WorkspacePath()

WorkspacePathLength = Len(WorkspacePath)

PathOnly = ThisDoc.Path

Pathlength = Len(PathOnly)

If Pathlength &amp;gt; WorkspacePathLength Then
	DirectoryPath = Strings.Right(PathOnly, Pathlength - WorkspacePathLength)
Else
	DirectoryPath = Strings.Right(PathOnly, WorkspacePathLength - Pathlength)
End If  

PDFPath = "\\sbs 2011\files\Z\Tegninger PDF"

If(Not System.IO.Directory.Exists(PDFPath)) Then
    System.IO.Directory.CreateDirectory(PDFPath)
End If

ThisDoc.Document.SaveAs(PDFPath &amp;amp; "\" &amp;amp; ThisDoc.FileName(False) &amp;amp; ".pdf" , True)&lt;/PRE&gt;
&lt;P&gt;Thanks and regards,&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jun 2019 11:29:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-save-idw-sheet-as-pdf/m-p/8864799#M98631</guid>
      <dc:creator>chandra.shekar.g</dc:creator>
      <dc:date>2019-06-21T11:29:54Z</dc:date>
    </item>
  </channel>
</rss>

