<?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: Export Idw to DXF in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/export-idw-to-dxf/m-p/7540160#M96084</link>
    <description>&lt;P&gt;Thanks for the response Cattabinil.&lt;/P&gt;
&lt;DIV class="username_area"&gt;&lt;SPAN&gt;This is how I started this project using this procedure. It exports the flat pattern with ease, but I need to add text to the dxf file. I was able to edit the dxf using streamwriter but it is slow. Really slow like 2 minutes. The flat pattern has about 100 holes in it so when you open the dxf in notepad it is really long.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV class="username_area"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="username_area"&gt;&lt;SPAN&gt;Below is the code I used to edit the dxf file. &lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV class="username_area"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="username_area"&gt;&lt;SPAN&gt;If you have a faster way of adding text to the dxf file or some way to add the text&amp;nbsp;before I export it to dxf that would be great.&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV class="username_area"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="username_area"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="username_area"&gt;
&lt;PRE&gt;&lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Public&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Sub&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;EditDXFFile&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;TextToAdd&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;String&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;)&lt;/SPAN&gt;

&lt;SPAN style="color: rgb(128, 0, 0);"&gt;FileName&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;ThisDoc&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;FileName&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;False&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;)&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(128, 0, 0);"&gt;oPath&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;ThisDoc&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;Path&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(128, 0, 0);"&gt;oRevNum&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;iProperties&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;Value&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;Project&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;Revision Number&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;)&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;oRevNum&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;0&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Or&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;oRevNum&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 128, 128);"&gt;""&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Then&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;oRevNum&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;1&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(128, 0, 0);"&gt;sFname&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;oPath&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;\&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;FileName&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;_&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;oRevNum&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;&amp;amp; ".dxf"&lt;/SPAN&gt;

&lt;SPAN style="color: rgb(128, 0, 0);"&gt;sourcePath&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;sFname&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;.dxf&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(128, 0, 0);"&gt;destinationPath&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;sFname&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;.txt&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;

&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;Check that the source file exists" If not then stop running&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;System&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;io&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;file&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;Exists&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;sourcePath&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;)&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0);"&gt;False&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Then&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Exit Sub&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;Check that the destination file exists: If it does delete it&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;System&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;io&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;file&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;Exists&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;destinationPath&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;)&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0);"&gt;True&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Then&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;System&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;io&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;file&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;Delete&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;destinationPath&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;)&lt;/SPAN&gt;

&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;Change dxf to a text file so text can be added to it&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;System&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;IO&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;File&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;Move&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;sourcePath&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;destinationPath&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;)&lt;/SPAN&gt;

&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;Start reading each line of the text file&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;
'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;Search for the Word "ENTITIES". This is where the entities begin in the file&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;file&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;System&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;IO&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;File&lt;/SPAN&gt;  
&lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;line&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;String&lt;/SPAN&gt; 
&lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;reader&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;()&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;String&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;System&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;IO&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;File&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;ReadAllLines&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;destinationPath&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;)&lt;/SPAN&gt;

&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;____Open and read a text file_______________________&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(128, 0, 0);"&gt;oRead&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;System&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;IO&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;File&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;OpenText&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;destinationPath&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;)&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(128, 0, 0);"&gt;EntireFile&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;oRead&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;ReadToEnd&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;()&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(128, 0, 0);"&gt;oRead&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;Close&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;()&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;System&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;IO&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;File&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;Delete&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;destinationPath&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;)&lt;/SPAN&gt;


&lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;FoundEntities&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0);"&gt;as&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Boolean&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0);"&gt;False&lt;/SPAN&gt;

&lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;NewFileText&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;String&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;count&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Integer&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;0&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;For&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Each&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;sLine&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;In&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;reader&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;FoundEntities&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0);"&gt;False&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Then&lt;/SPAN&gt;
        &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;sline&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;Contains&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;ENTITIES&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;)&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Then&lt;/SPAN&gt; 
            &lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;MsgBox("Found ENTITIES")&lt;/SPAN&gt;
            &lt;SPAN style="color: rgb(128, 0, 0);"&gt;FoundEntities&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0);"&gt;True&lt;/SPAN&gt;
        &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;If&lt;/SPAN&gt; 
    &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;ElseIf&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;AddedMtaxt&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0);"&gt;False&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Then&lt;/SPAN&gt;
        &lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;Find the end of the ENTITIES by searching for the next ENDSEC&lt;/SPAN&gt;
        &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;sline&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;Contains&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;ENDSEC&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;)&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Then&lt;/SPAN&gt;
            &lt;SPAN style="color: rgb(128, 0, 0);"&gt;NewFileText&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;&amp;amp;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0);"&gt;vbNewLine&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;TextToAdd&lt;/SPAN&gt;
            &lt;SPAN style="color: rgb(128, 0, 0);"&gt;NewFileText&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;&amp;amp;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0);"&gt;vbNewLine&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;0&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;
            &lt;SPAN style="color: rgb(128, 0, 0);"&gt;AddedMtaxt&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0);"&gt;True&lt;/SPAN&gt;
        &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;If&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;If&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;count&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;0&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Then&lt;/SPAN&gt;
        &lt;SPAN style="color: rgb(128, 0, 0);"&gt;NewFileText&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;sLine&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Else&lt;/SPAN&gt;
        &lt;SPAN style="color: rgb(128, 0, 0);"&gt;NewFileText&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;&amp;amp;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0);"&gt;vbNewLine&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;sLine&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;If&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(128, 0, 0);"&gt;count&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;count&lt;/SPAN&gt;&lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;+&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;1&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;ThisApplication&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;StatusBarText&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;count&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Next&lt;/SPAN&gt;
 

&lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;ThisApplication&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;StatusBarText&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;Checking the orginal file and deleting if needed&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;Check that the source file exists" If it does delete it&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;System&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;io&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;file&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;Exists&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;sourcePath&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;)&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0);"&gt;True&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Then&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;System&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;io&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;file&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;Delete&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;sourcePath&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;)&lt;/SPAN&gt;

&lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;ThisApplication&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;StatusBarText&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;Creating the new file&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;____Create and write to a text file_________________&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(128, 0, 0);"&gt;oWrite&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;System&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;IO&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;File&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;CreateText&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;destinationPath&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;)&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(128, 0, 0);"&gt;oWrite&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;WriteLine&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;NewFileText&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;)&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(128, 0, 0);"&gt;oWrite&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;Close&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;()&lt;/SPAN&gt;

&lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;ThisApplication&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;StatusBarText&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;Renaming the file&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;

&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;Return txt file to a dxf file&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;System&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;IO&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;File&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;Move&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;destinationPath&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;sourcePath&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;)&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;End Sub&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 13 Nov 2017 18:23:43 GMT</pubDate>
    <dc:creator>meck</dc:creator>
    <dc:date>2017-11-13T18:23:43Z</dc:date>
    <item>
      <title>Export Idw to DXF</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/export-idw-to-dxf/m-p/7539297#M96076</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;I've been trying to get the Inventor help sample code PublishDXF to work, but I keep getting an error on line "Call DXFAddIn.SaveCopyAs(oDocument, oContext, oOptions, oDataMedium)" The error message in attached. I'm running the code in an .ipt file using iLogic. I unfold&amp;nbsp;a sheet metal part then place the flat pattern on an .idw with some text. I set the .idw active and then call the PublishDXF&amp;nbsp;sub.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It may help if I knew what all the pieces of the code was doing. For instance what is the purpose of creating.ini file,&amp;nbsp;&amp;nbsp;if that's what it is doing? Does it have to be placed in a certain location? It's just very difficult to debug when I do not know what any of the arguments are doing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've tried running the code in VBA from inside the idw, but I get the same error.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please can someone give me some direction?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Nov 2017 13:57:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/export-idw-to-dxf/m-p/7539297#M96076</guid>
      <dc:creator>meck</dc:creator>
      <dc:date>2017-11-13T13:57:19Z</dc:date>
    </item>
    <item>
      <title>Re: Export Idw to DXF</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/export-idw-to-dxf/m-p/7539386#M96077</link>
      <description>&lt;P&gt;Are you sure the error occurs on SaveCopyAs line? From your image it seems HasSaveCopyAsOptions method throwing the error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you paste here your code?&lt;/P&gt;</description>
      <pubDate>Mon, 13 Nov 2017 14:23:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/export-idw-to-dxf/m-p/7539386#M96077</guid>
      <dc:creator>CattabianiI</dc:creator>
      <dc:date>2017-11-13T14:23:32Z</dc:date>
    </item>
    <item>
      <title>Re: Export Idw to DXF</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/export-idw-to-dxf/m-p/7539496#M96078</link>
      <description>&lt;P&gt;Oops! Your correct. I was tinkering trying to get something to work and I edited that line of code. I changed it back and now I get the error on Call DXFAddIn.SaveCopyAs(oDocument, oContext, oOptions, oDataMedium).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See attached...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BTW thanks for posting so quickly!!!!&lt;/P&gt;</description>
      <pubDate>Mon, 13 Nov 2017 14:47:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/export-idw-to-dxf/m-p/7539496#M96078</guid>
      <dc:creator>meck</dc:creator>
      <dc:date>2017-11-13T14:47:43Z</dc:date>
    </item>
    <item>
      <title>Re: Export Idw to DXF</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/export-idw-to-dxf/m-p/7539572#M96079</link>
      <description>&lt;P&gt;Not easy to give you guidance without your code to look at.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Nov 2017 15:09:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/export-idw-to-dxf/m-p/7539572#M96079</guid>
      <dc:creator>MechMachineMan</dc:creator>
      <dc:date>2017-11-13T15:09:02Z</dc:date>
    </item>
    <item>
      <title>Re: Export Idw to DXF</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/export-idw-to-dxf/m-p/7539597#M96080</link>
      <description>&lt;P&gt;Here is the code of the entire rule.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Remember&amp;nbsp;this is in an .ipt sheet metal file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Imports&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;Inventor&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;ViewOrientationTypeEnum&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Imports&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;Inventor&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;DrawingViewStyleEnum&lt;/SPAN&gt;

&lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Sub&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;Main&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;Exit Sub&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Call&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;CreateFlatInPart&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Call&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;MakeFlatPattern&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;1&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;)&lt;/SPAN&gt;
    
    &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;PartName&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;String&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;PART NUMBER: &lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;ThisDoc&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;FileName&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;False&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;)&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;without extension&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;RevNo&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;String&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;REVISION NUMBER: &lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;iProperties&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;Value&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;Project&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;Revision Number&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;)&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;Matl&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0);"&gt;as&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;String&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;MATERIAL: &lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;iProperties&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;Material&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;Drafter&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;String&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;DESIGNER: &lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;iProperties&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;Value&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;Project&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;Designer&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;)&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;sText&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;String&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(128, 0, 0);"&gt;sText&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;PartName&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0);"&gt;vbNewLine&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;RevNo&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0);"&gt;vbNewLine&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;Matl&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0);"&gt;vbNewLine&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;Drafter&lt;/SPAN&gt;
    
    &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Call&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;AddGeneralNote&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;sText&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;0&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;0&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;)&lt;/SPAN&gt;
    
   
    &lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;Call ExportToDXF&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Call&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;PublishDXF&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;ThisDoc&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;PathAndFileName&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;False&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;))&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;End Sub&lt;/SPAN&gt;

&lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Public&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Sub&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;CreateFlatInPart&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;This sub creates a flat parttern within the sheetmetal model file.&lt;/SPAN&gt;

&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;Connect to the active document&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;oDoc&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;PartDocument&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(128, 0, 0);"&gt;oDoc&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;ThisApplication&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;ActiveDocument&lt;/SPAN&gt;

&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;Make a sheet metal component&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;oCompDef&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;SheetMetalComponentDefinition&lt;/SPAN&gt;

&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;Try setting the part file to sheet metal (This is just a test to make sure the file is sheet metal)&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Try&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(128, 0, 0);"&gt;oCompDef&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;oDoc&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;ComponentDefinition&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Catch&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;ThisApplication&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;SilentOperation&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0);"&gt;False&lt;/SPAN&gt;    
    &lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;MessageBox&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;Show&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;A sheet metal part file must be active to generate the flat pattern.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;Invalid Part File!&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;)&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Exit Sub&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Try&lt;/SPAN&gt;

&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;Unfold the part file if it is not already unfolded&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;oCompDef&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;HasFlatPattern&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0);"&gt;False&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Then&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(128, 0, 0);"&gt;oCompDef&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;Unfold&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Else&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(128, 0, 0);"&gt;oCompDef&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;FlatPattern&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;Edit&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;If&lt;/SPAN&gt;

&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;Try switching back to the folded part&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Try&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(128, 0, 0);"&gt;oCompDef&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;FlatPattern&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;ExitEdit&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Catch&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;MsgBox("Error Exitting Flat Pattern!")&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Try&lt;/SPAN&gt;

&lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;End Sub&lt;/SPAN&gt;



&lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Public&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Sub&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;MakeFlatPattern&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;ViewScale&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Double&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;)&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;This rule creates a 1:1 scale flat pattern on a blank idw&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;
'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;IMPORTANT!!!!!!!!!&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;
'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;These Imports MUST be added at the top of the rule in order for this sub to work!&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;
'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;    Imports Inventor.ViewOrientationTypeEnum&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;
'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;    Imports Inventor.DrawingViewStyleEnum&lt;/SPAN&gt;

&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;Declare required objects&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;oDrawingDoc&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;DrawingDocument&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;oPartDoc&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;Document&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;oSheet&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;Sheet&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;oView4&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;DrawingView&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;ViewScale = 1&lt;/SPAN&gt;

&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;Connect to the active part&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(128, 0, 0);"&gt;oPartDoc&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;ThisApplication&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;ActiveDocument&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;Define IDW Template File Location&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(128, 0, 0);"&gt;oDrawingDoc&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;ThisApplication&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;Documents&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;Add&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;kDrawingDocumentObject&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;""&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;True&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;)&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;Connect to the first drawing sheet&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(128, 0, 0);"&gt;oSheet&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;oDrawingDoc&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;Sheets&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;Item&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;1&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;)&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt; Create a new NameValueMap object&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;oBaseViewOptions&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;NameValueMap&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(128, 0, 0);"&gt;oBaseViewOptions&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;ThisApplication&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;TransientObjects&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;CreateNameValueMap&lt;/SPAN&gt;

&lt;SPAN style="color: rgb(128, 0, 0);"&gt;oBaseViewOptions&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;Add&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;(&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;SheetMetalFoldedModel&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;False&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;)&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;Define 2d view bottom left corner points for four views&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(128, 0, 0);"&gt;oPoint4&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;ThisApplication&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;TransientGeometry&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;CreatePoint2d&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;20&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;18&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;)&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt; flat pattern&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(128, 0, 0);"&gt;oView4&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;oSheet&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;DrawingViews&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;AddBaseView&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;oPartDoc&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;oPoint4&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;ViewScale&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;kDefaultViewOrientation&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;kHiddenLineDrawingViewStyle&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;, , , &lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;oBaseViewOptions&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;)&lt;/SPAN&gt;

&lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;End Sub&lt;/SPAN&gt;

&lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Public&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Sub&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;AddGeneralNote&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;sText&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;String&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;XPos&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Double&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;YPos&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Double&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;)&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;This sub places sText on the active drawing sheet @ (Xos, YPos)&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(128, 0, 0);"&gt;XPos&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;XPos&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;*&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;2.54&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(128, 0, 0);"&gt;YPos&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;YPos&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;*&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;2.54&lt;/SPAN&gt;
    
    &lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt; a reference to the drawing document.&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt; This assumes a drawing document is active.&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;oDrawDoc&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;DrawingDocument&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(128, 0, 0);"&gt;oDrawDoc&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;ThisApplication&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;ActiveDocument&lt;/SPAN&gt;

    &lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt; a reference to the active sheet.&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;oActiveSheet&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;Sheet&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(128, 0, 0);"&gt;oActiveSheet&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;oDrawDoc&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;ActiveSheet&lt;/SPAN&gt;
    
    &lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt; a reference to the GeneralNotes object&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;oGeneralNotes&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;GeneralNotes&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(128, 0, 0);"&gt;oGeneralNotes&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;oActiveSheet&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;DrawingNotes&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;GeneralNotes&lt;/SPAN&gt;
    
    &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;oTG&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;TransientGeometry&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(128, 0, 0);"&gt;oTG&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;ThisApplication&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;TransientGeometry&lt;/SPAN&gt;

    &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;oGeneralNote&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;GeneralNote&lt;/SPAN&gt;
    
    &lt;SPAN style="color: rgb(128, 0, 0);"&gt;oGeneralNote&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;oGeneralNotes&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;AddFitted&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;oTG&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;CreatePoint2d&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;XPos&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;YPos&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;)&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;sText&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;)&lt;/SPAN&gt;

    &lt;SPAN style="color: rgb(128, 0, 0);"&gt;oDrawDoc&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0);"&gt;Nothing&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(128, 0, 0);"&gt;oActiveSheet&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0);"&gt;Nothing&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(128, 0, 0);"&gt;oGeneralNotes&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0);"&gt;Nothing&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(128, 0, 0);"&gt;oTG&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0);"&gt;Nothing&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(128, 0, 0);"&gt;oGeneralNote&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0);"&gt;Nothing&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;End Sub&lt;/SPAN&gt;

&lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Public&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Sub&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;PublishDXF&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;PathToSave&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;String&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;)&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt; Get the DXF translator Add-In.&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;DXFAddIn&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;TranslatorAddIn&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(128, 0, 0);"&gt;transID&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;{C24E3AC4-122E-11D5-8E91-0010B541CD80}&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(128, 0, 0);"&gt;DXFAddIn&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;ThisApplication&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;ApplicationAddIns&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;ItemById&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;transID&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;)&lt;/SPAN&gt;
    
    &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;DXFAddIn&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;Activated&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0);"&gt;False&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Then&lt;/SPAN&gt;
         &lt;SPAN style="color: rgb(128, 0, 0);"&gt;DXFAddIn&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;Activate&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;()&lt;/SPAN&gt;
     &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;If&lt;/SPAN&gt;
    
    &lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;Set a reference to the active document (the document to be published).&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;oDocument&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;Document&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(128, 0, 0);"&gt;oDocument&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;ThisApplication&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;ActiveDocument&lt;/SPAN&gt;

    &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;oContext&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;TranslationContext&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(128, 0, 0);"&gt;oContext&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;ThisApplication&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;TransientObjects&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;CreateTranslationContext&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;oContext.Type = kFileBrowseIOMechanism&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(128, 0, 0);"&gt;oContext&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;Type&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;IOMechanismEnum&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;kFileBrowseIOMechanism&lt;/SPAN&gt; 
    
    &lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt; Create a NameValueMap object&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;oOptions&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;NameValueMap&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(128, 0, 0);"&gt;oOptions&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;ThisApplication&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;TransientObjects&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;CreateNameValueMap&lt;/SPAN&gt;

    &lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt; Check whether the translator has 'SaveCopyAs' options&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;DXFAddIn&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;HasSaveCopyAsOptions&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;oDocument&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;oContext&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;oOptions&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;)&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Then&lt;/SPAN&gt;
        &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;strIniFile&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;String&lt;/SPAN&gt;
        &lt;SPAN style="color: rgb(128, 0, 0);"&gt;strIniFile&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;C:\temp\dxfout.ini&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;

        &lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt; Create the name-value that specifies the ini file to use.&lt;/SPAN&gt;
        &lt;SPAN style="color: rgb(128, 0, 0);"&gt;oOptions&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;Value&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;Export_Acad_IniFile&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;)&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;strIniFile&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;If&lt;/SPAN&gt;


    &lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt; Create a DataMedium object&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;oDataMedium&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;DataMedium&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(128, 0, 0);"&gt;oDataMedium&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;ThisApplication&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;TransientObjects&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;CreateDataMedium&lt;/SPAN&gt;

    &lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;Set the destination file name&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;MsgBox(PathToSave &amp;amp; ".dxf")&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(128, 0, 0);"&gt;oDataMedium&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;FileName&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;PathToSave&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;.dxf&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;

    &lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;DXF Exporter does NOT overwrite and will hang if previous files found&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;System&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;IO&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;File&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;Exists&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;oDataMedium&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;FileName&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;)&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Then&lt;/SPAN&gt;
        &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;System&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;IO&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;File&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;Delete&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;oDataMedium&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;FileName&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;)&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;If&lt;/SPAN&gt;

    &lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;Publish document.&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Call&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;DXFAddIn&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;SaveCopyAs&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;oDocument&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;oContext&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;oOptions&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;oDataMedium&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;)&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;End Sub&lt;/SPAN&gt;
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Nov 2017 15:19:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/export-idw-to-dxf/m-p/7539597#M96080</guid>
      <dc:creator>meck</dc:creator>
      <dc:date>2017-11-13T15:19:01Z</dc:date>
    </item>
    <item>
      <title>Re: Export Idw to DXF</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/export-idw-to-dxf/m-p/7539693#M96081</link>
      <description>&lt;P&gt;Have you verified that the Make DXF section of the rule is actually grabbing the drawing document, and not actually the part document? It usually makes sense to pass the document object in the code instead of assuming that the document you want is always the active one....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The modified version below is half done, to give you an idea of what i mean.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Imports Inventor.ViewOrientationTypeEnum
Imports Inventor.DrawingViewStyleEnum

Sub Main
'Exit Sub
	Dim oPartDoc As PartDocument
	On Error Resume Next
		oPartDoc = ThisApplication.ActiveDocument
		If Err.Number &amp;lt;&amp;gt; 0 Then
			MsgBox("Rule only valid for part documents!")
			Exit Sub
		End If
	On Error Goto 0

    Call CreateFlatInPart(oPartDoc)
	
	Dim oDwgDoc As DrawingDocument
    Call MakeFlatPattern(oPartDoc, oDwgDoc, 1)
    
	'Need to change this yet
    Dim PartName As String = "PART NUMBER: " &amp;amp; ThisDoc.FileName(False) 'without extension
    Dim RevNo As String = "REVISION NUMBER: " &amp;amp; iProperties.Value("Project", "Revision Number")
    Dim Matl as String = "MATERIAL: " &amp;amp; iProperties.Material
    Dim Drafter As String = "DESIGNER: " &amp;amp; iProperties.Value("Project", "Designer")
    Dim sText As String
    sText = PartName &amp;amp; vbNewLine &amp;amp; RevNo &amp;amp; vbNewLine &amp;amp; Matl &amp;amp; vbNewLine &amp;amp; Drafter
    
    Call AddGeneralNote(sText, 0, 0)
    
   
    'Call ExportToDXF
    Call PublishDXF(oDwgDoc, ThisDoc.PathAndFileName(False))
End Sub

Public Sub CreateFlatInPart(oDoc As Document)
	'This sub creates a flat parttern within the sheetmetal model file.
	
	'Make a sheet metal component
	Dim oCompDef As SheetMetalComponentDefinition
	
	'Try setting the part file to sheet metal (This is just a test to make sure the file is sheet metal)
	Try
		oCompDef = oDoc.ComponentDefinition
	Catch
		ThisApplication.SilentOperation = False    
		MessageBox.Show("A sheet metal part file must be active to generate the flat pattern.", "Invalid Part File!")
		Exit Sub
	End Try
	
	'Unfold the part file if it is not already unfolded
	If oCompDef.HasFlatPattern = False Then
		oCompDef.Unfold
	Else
		oCompDef.FlatPattern.Edit
	End If
	
	'Try switching back to the folded part
	Try
		oCompDef.FlatPattern.ExitEdit
	Catch
		'MsgBox("Error Exitting Flat Pattern!")
	End Try

End Sub



Public Sub MakeFlatPattern(oPartDoc As Document, ByRef oDrawingDoc As DrawingDocument, ViewScale As Double)
	'This rule creates a 1:1 scale flat pattern on a blank idw
	'IMPORTANT!!!!!!!!!
	'These Imports MUST be added at the top of the rule in order for this sub to work!
	'    Imports Inventor.ViewOrientationTypeEnum
	'    Imports Inventor.DrawingViewStyleEnum
	
	'Declare required objects
	Dim oDrawingDoc As DrawingDocument
	Dim oPartDoc As Document
	Dim oSheet As Sheet
	Dim oView4 As DrawingView
	'ViewScale = 1
	
	'Define IDW Template File Location
	oDrawingDoc = ThisApplication.Documents.Add(kDrawingDocumentObject, "", True)
	'Connect to the first drawing sheet
	oSheet = oDrawingDoc.Sheets.Item(1)
	' Create a new NameValueMap object
	Dim oBaseViewOptions As NameValueMap
	oBaseViewOptions = ThisApplication.TransientObjects.CreateNameValueMap
	
	oBaseViewOptions.Add( "SheetMetalFoldedModel", False)
	'Define 2d view bottom left corner points for four views
	oPoint4 = ThisApplication.TransientGeometry.CreatePoint2d(20, 18) ' flat pattern
	oView4 = oSheet.DrawingViews.AddBaseView(oPartDoc, oPoint4, ViewScale, kDefaultViewOrientation, kHiddenLineDrawingViewStyle, , , oBaseViewOptions)

End Sub

Public Sub AddGeneralNote(sText As String, XPos As Double, YPos As Double)
    'This sub places sText on the active drawing sheet @ (Xos, YPos)
    XPos = XPos * 2.54
    YPos = YPos * 2.54
    
    ' a reference to the drawing document.
    ' This assumes a drawing document is active.
    Dim oDrawDoc As DrawingDocument
    oDrawDoc = ThisApplication.ActiveDocument

    ' a reference to the active sheet.
    Dim oActiveSheet As Sheet
    oActiveSheet = oDrawDoc.ActiveSheet
    
    ' a reference to the GeneralNotes object
    Dim oGeneralNotes As GeneralNotes
    oGeneralNotes = oActiveSheet.DrawingNotes.GeneralNotes
    
    Dim oTG As TransientGeometry
    oTG = ThisApplication.TransientGeometry

    Dim oGeneralNote As GeneralNote
    
    oGeneralNote = oGeneralNotes.AddFitted(oTG.CreatePoint2d(XPos, YPos), sText)

    oDrawDoc = Nothing
    oActiveSheet = Nothing
    oGeneralNotes = Nothing
    oTG = Nothing
    oGeneralNote = Nothing
End Sub

Public Sub PublishDXF(oDocument As DrawingDocument, PathToSave As String)
    ' Get the DXF translator Add-In.
    Dim DXFAddIn As TranslatorAddIn
    transID = "{C24E3AC4-122E-11D5-8E91-0010B541CD80}"
    DXFAddIn = ThisApplication.ApplicationAddIns.ItemById(transID)
    
    If DXFAddIn.Activated = False Then
         DXFAddIn.Activate()
     End If

    Dim oContext As TranslationContext
    oContext = ThisApplication.TransientObjects.CreateTranslationContext
    'oContext.Type = kFileBrowseIOMechanism
    oContext.Type = IOMechanismEnum.kFileBrowseIOMechanism 
    
    ' Create a NameValueMap object
    Dim oOptions As NameValueMap
    oOptions = ThisApplication.TransientObjects.CreateNameValueMap

    ' Check whether the translator has 'SaveCopyAs' options
    If DXFAddIn.HasSaveCopyAsOptions(oDocument, oContext, oOptions) Then
        Dim strIniFile As String
        strIniFile = "C:\temp\dxfout.ini"

        ' Create the name-value that specifies the ini file to use.
        oOptions.Value("Export_Acad_IniFile") = strIniFile
    End If


    ' Create a DataMedium object
    Dim oDataMedium As DataMedium
    oDataMedium = ThisApplication.TransientObjects.CreateDataMedium

    'Set the destination file name
    'MsgBox(PathToSave &amp;amp; ".dxf")
    oDataMedium.FileName = PathToSave &amp;amp; ".dxf"

    'DXF Exporter does NOT overwrite and will hang if previous files found
    If System.IO.File.Exists(oDataMedium.FileName) Then
        System.IO.File.Delete(oDataMedium.FileName)
    End If

    'Publish document.
    Call DXFAddIn.SaveCopyAs(oDocument, oContext, oOptions, oDataMedium)
End Sub&lt;/PRE&gt;</description>
      <pubDate>Mon, 13 Nov 2017 16:02:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/export-idw-to-dxf/m-p/7539693#M96081</guid>
      <dc:creator>MechMachineMan</dc:creator>
      <dc:date>2017-11-13T16:02:47Z</dc:date>
    </item>
    <item>
      <title>Re: Export Idw to DXF</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/export-idw-to-dxf/m-p/7539744#M96082</link>
      <description>&lt;P&gt;I am really appreciating the quick responses. Thanks people!!!!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I saved the .idw. Then I placed just the PublishDXF sub into a rule and ran the code (see below). I get the same error.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;PRE&gt;&lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Sub&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;Main&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(128, 0, 0);"&gt;Trigger&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;iTrigger0&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Call&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;PublishDXF&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;ThisDoc&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;PathAndFileName&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;False&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;))&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;iLogicVb&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;UpdateWhenDone&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0);"&gt;True&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;End Sub&lt;/SPAN&gt;

&lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Public&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Sub&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;PublishDXF&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;PathToSave&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;String&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;)&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt; Get the DXF translator Add-In.&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;DXFAddIn&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;TranslatorAddIn&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(128, 0, 0);"&gt;transID&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;{C24E3AC4-122E-11D5-8E91-0010B541CD80}&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(128, 0, 0);"&gt;DXFAddIn&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;ThisApplication&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;ApplicationAddIns&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;ItemById&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;transID&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;)&lt;/SPAN&gt;
    
    &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;DXFAddIn&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;Activated&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0);"&gt;False&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Then&lt;/SPAN&gt;
         &lt;SPAN style="color: rgb(128, 0, 0);"&gt;DXFAddIn&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;Activate&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;()&lt;/SPAN&gt;
     &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;If&lt;/SPAN&gt;
    
    &lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;Set a reference to the active document (the document to be published).&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;oDocument&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;Document&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(128, 0, 0);"&gt;oDocument&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;ThisApplication&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;ActiveDocument&lt;/SPAN&gt;

    &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;oContext&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;TranslationContext&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(128, 0, 0);"&gt;oContext&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;ThisApplication&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;TransientObjects&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;CreateTranslationContext&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;oContext.Type = kFileBrowseIOMechanism&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(128, 0, 0);"&gt;oContext&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;Type&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;IOMechanismEnum&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;kFileBrowseIOMechanism&lt;/SPAN&gt; 
    
    &lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt; Create a NameValueMap object&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;oOptions&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;NameValueMap&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(128, 0, 0);"&gt;oOptions&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;ThisApplication&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;TransientObjects&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;CreateNameValueMap&lt;/SPAN&gt;

    &lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt; Check whether the translator has 'SaveCopyAs' options&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;DXFAddIn&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;HasSaveCopyAsOptions&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;oDocument&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;oContext&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;oOptions&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;)&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Then&lt;/SPAN&gt;
        &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;strIniFile&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;String&lt;/SPAN&gt;
        &lt;SPAN style="color: rgb(128, 0, 0);"&gt;strIniFile&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;C:\temp\dxfout.ini&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;

        &lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt; Create the name-value that specifies the ini file to use.&lt;/SPAN&gt;
        &lt;SPAN style="color: rgb(128, 0, 0);"&gt;oOptions&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;Value&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;Export_Acad_IniFile&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;)&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;strIniFile&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;If&lt;/SPAN&gt;

    &lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt; Create a DataMedium object&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;oDataMedium&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;DataMedium&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(128, 0, 0);"&gt;oDataMedium&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;ThisApplication&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;TransientObjects&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;CreateDataMedium&lt;/SPAN&gt;

    &lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;Set the destination file name&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;MsgBox(PathToSave &amp;amp; ".dxf")&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(128, 0, 0);"&gt;oDataMedium&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;FileName&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;PathToSave&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;.dxf&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;

    &lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;DXF Exporter does NOT overwrite and will hang if previous files found&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;System&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;IO&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;File&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;Exists&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;oDataMedium&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;FileName&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;)&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Then&lt;/SPAN&gt;
        &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;System&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;IO&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;File&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;Delete&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;oDataMedium&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;FileName&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;)&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;If&lt;/SPAN&gt;

    &lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;Publish document.&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Call&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;DXFAddIn&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;SaveCopyAs&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;oDocument&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;oContext&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;oOptions&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;oDataMedium&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;)&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;End Sub&lt;/SPAN&gt;
 &lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Nov 2017 16:07:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/export-idw-to-dxf/m-p/7539744#M96082</guid>
      <dc:creator>meck</dc:creator>
      <dc:date>2017-11-13T16:07:21Z</dc:date>
    </item>
    <item>
      <title>Re: Export Idw to DXF</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/export-idw-to-dxf/m-p/7539936#M96083</link>
      <description>&lt;P&gt;Try using &lt;A href="http://help.autodesk.com/view/INVNTOR/2018/ENU/?query=DataIO%20dxf" target="_blank"&gt;DataIO API&lt;/A&gt; instead of TranslatorAddin&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your PublishDXF method should be something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SyntaxEditor Code Snippet&lt;/P&gt;&lt;PRE&gt; Public PublishDXF(PathToSave As String)&lt;BR /&gt;    &lt;SPAN&gt;'&lt;/SPAN&gt;&lt;SPAN&gt; Get the active document. This assumes it is a part document.&lt;/SPAN&gt;
    &lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oDoc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;PartDocument&lt;/SPAN&gt;
    &lt;SPAN&gt;oDoc&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;ActiveDocument&lt;/SPAN&gt;
&lt;SPAN&gt;    '&lt;/SPAN&gt;&lt;SPAN&gt; Get the DataIO object.&lt;/SPAN&gt;
    &lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oDataIO&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;DataIO&lt;/SPAN&gt;
    &lt;SPAN&gt;oDataIO&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;oDoc&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;ComponentDefinition&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;DataIO&lt;/SPAN&gt;
    &lt;SPAN&gt;'&lt;/SPAN&gt;&lt;SPAN&gt; Build the string that defines the format of the DXF file.&lt;/SPAN&gt;
    &lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;sOut&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;String&lt;/SPAN&gt;
    &lt;SPAN&gt;sOut&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;FLAT PATTERN DXF?AcadVersion=R12&amp;amp;OuterProfileLayer=Outer&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;
&lt;SPAN&gt;    '&lt;/SPAN&gt;&lt;SPAN&gt; Create the DXF file.&lt;/SPAN&gt;
    &lt;SPAN&gt;oDataIO&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;WriteDataToFile&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;sOut&lt;/SPAN&gt;&lt;SPAN&gt;, PathToSave + "&lt;/SPAN&gt;&lt;SPAN&gt;.dxf&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;BR /&gt;&lt;/SPAN&gt;End Sub
 &lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For set the options you interested in refer to the link above or google "FlatPattern to dxf DataIO"&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Nov 2017 17:10:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/export-idw-to-dxf/m-p/7539936#M96083</guid>
      <dc:creator>CattabianiI</dc:creator>
      <dc:date>2017-11-13T17:10:38Z</dc:date>
    </item>
    <item>
      <title>Re: Export Idw to DXF</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/export-idw-to-dxf/m-p/7540160#M96084</link>
      <description>&lt;P&gt;Thanks for the response Cattabinil.&lt;/P&gt;
&lt;DIV class="username_area"&gt;&lt;SPAN&gt;This is how I started this project using this procedure. It exports the flat pattern with ease, but I need to add text to the dxf file. I was able to edit the dxf using streamwriter but it is slow. Really slow like 2 minutes. The flat pattern has about 100 holes in it so when you open the dxf in notepad it is really long.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV class="username_area"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="username_area"&gt;&lt;SPAN&gt;Below is the code I used to edit the dxf file. &lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV class="username_area"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="username_area"&gt;&lt;SPAN&gt;If you have a faster way of adding text to the dxf file or some way to add the text&amp;nbsp;before I export it to dxf that would be great.&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV class="username_area"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="username_area"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="username_area"&gt;
&lt;PRE&gt;&lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Public&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Sub&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;EditDXFFile&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;TextToAdd&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;String&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;)&lt;/SPAN&gt;

&lt;SPAN style="color: rgb(128, 0, 0);"&gt;FileName&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;ThisDoc&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;FileName&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;False&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;)&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(128, 0, 0);"&gt;oPath&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;ThisDoc&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;Path&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(128, 0, 0);"&gt;oRevNum&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;iProperties&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;Value&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;Project&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;Revision Number&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;)&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;oRevNum&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;0&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Or&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;oRevNum&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 128, 128);"&gt;""&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Then&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;oRevNum&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;1&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(128, 0, 0);"&gt;sFname&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;oPath&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;\&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;FileName&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;_&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;oRevNum&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;&amp;amp; ".dxf"&lt;/SPAN&gt;

&lt;SPAN style="color: rgb(128, 0, 0);"&gt;sourcePath&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;sFname&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;.dxf&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(128, 0, 0);"&gt;destinationPath&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;sFname&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;.txt&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;

&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;Check that the source file exists" If not then stop running&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;System&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;io&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;file&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;Exists&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;sourcePath&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;)&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0);"&gt;False&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Then&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Exit Sub&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;Check that the destination file exists: If it does delete it&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;System&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;io&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;file&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;Exists&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;destinationPath&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;)&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0);"&gt;True&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Then&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;System&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;io&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;file&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;Delete&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;destinationPath&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;)&lt;/SPAN&gt;

&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;Change dxf to a text file so text can be added to it&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;System&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;IO&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;File&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;Move&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;sourcePath&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;destinationPath&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;)&lt;/SPAN&gt;

&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;Start reading each line of the text file&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;
'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;Search for the Word "ENTITIES". This is where the entities begin in the file&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;file&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;System&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;IO&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;File&lt;/SPAN&gt;  
&lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;line&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;String&lt;/SPAN&gt; 
&lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;reader&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;()&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;String&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;System&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;IO&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;File&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;ReadAllLines&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;destinationPath&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;)&lt;/SPAN&gt;

&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;____Open and read a text file_______________________&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(128, 0, 0);"&gt;oRead&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;System&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;IO&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;File&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;OpenText&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;destinationPath&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;)&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(128, 0, 0);"&gt;EntireFile&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;oRead&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;ReadToEnd&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;()&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(128, 0, 0);"&gt;oRead&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;Close&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;()&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;System&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;IO&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;File&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;Delete&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;destinationPath&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;)&lt;/SPAN&gt;


&lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;FoundEntities&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0);"&gt;as&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Boolean&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0);"&gt;False&lt;/SPAN&gt;

&lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;NewFileText&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;String&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;count&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Integer&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;0&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;For&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Each&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;sLine&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;In&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;reader&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;FoundEntities&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0);"&gt;False&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Then&lt;/SPAN&gt;
        &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;sline&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;Contains&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;ENTITIES&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;)&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Then&lt;/SPAN&gt; 
            &lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;MsgBox("Found ENTITIES")&lt;/SPAN&gt;
            &lt;SPAN style="color: rgb(128, 0, 0);"&gt;FoundEntities&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0);"&gt;True&lt;/SPAN&gt;
        &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;If&lt;/SPAN&gt; 
    &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;ElseIf&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;AddedMtaxt&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0);"&gt;False&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Then&lt;/SPAN&gt;
        &lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;Find the end of the ENTITIES by searching for the next ENDSEC&lt;/SPAN&gt;
        &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;sline&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;Contains&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;ENDSEC&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;)&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Then&lt;/SPAN&gt;
            &lt;SPAN style="color: rgb(128, 0, 0);"&gt;NewFileText&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;&amp;amp;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0);"&gt;vbNewLine&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;TextToAdd&lt;/SPAN&gt;
            &lt;SPAN style="color: rgb(128, 0, 0);"&gt;NewFileText&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;&amp;amp;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0);"&gt;vbNewLine&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;0&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;
            &lt;SPAN style="color: rgb(128, 0, 0);"&gt;AddedMtaxt&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0);"&gt;True&lt;/SPAN&gt;
        &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;If&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;If&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;count&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;0&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Then&lt;/SPAN&gt;
        &lt;SPAN style="color: rgb(128, 0, 0);"&gt;NewFileText&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;sLine&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Else&lt;/SPAN&gt;
        &lt;SPAN style="color: rgb(128, 0, 0);"&gt;NewFileText&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;&amp;amp;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0);"&gt;vbNewLine&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;sLine&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;If&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(128, 0, 0);"&gt;count&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;count&lt;/SPAN&gt;&lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;+&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;1&lt;/SPAN&gt;
    &lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;ThisApplication&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;StatusBarText&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(128, 0, 0);"&gt;count&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Next&lt;/SPAN&gt;
 

&lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;ThisApplication&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;StatusBarText&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;Checking the orginal file and deleting if needed&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;Check that the source file exists" If it does delete it&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;System&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;io&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;file&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;Exists&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;sourcePath&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;)&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0);"&gt;True&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Then&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;System&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;io&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;file&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;Delete&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;sourcePath&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;)&lt;/SPAN&gt;

&lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;ThisApplication&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;StatusBarText&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;Creating the new file&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;____Create and write to a text file_________________&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(128, 0, 0);"&gt;oWrite&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;System&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;IO&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;File&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;CreateText&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;destinationPath&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;)&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(128, 0, 0);"&gt;oWrite&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;WriteLine&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;NewFileText&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;)&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(128, 0, 0);"&gt;oWrite&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;Close&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;()&lt;/SPAN&gt;

&lt;SPAN style="color: rgb(128, 0, 128); font-weight: bold;"&gt;ThisApplication&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;StatusBarText&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;Renaming the file&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 128, 128);"&gt;"&lt;/SPAN&gt;

&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 128, 128); font-style: italic;"&gt;Return txt file to a dxf file&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;System&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;IO&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;File&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;Move&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;destinationPath&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: rgb(128, 0, 0);"&gt;sourcePath&lt;/SPAN&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-weight: bold;"&gt;)&lt;/SPAN&gt;
&lt;SPAN style="color: rgb(255, 0, 0); font-weight: bold;"&gt;End Sub&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Nov 2017 18:23:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/export-idw-to-dxf/m-p/7540160#M96084</guid>
      <dc:creator>meck</dc:creator>
      <dc:date>2017-11-13T18:23:43Z</dc:date>
    </item>
    <item>
      <title>Re: Export Idw to DXF</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/export-idw-to-dxf/m-p/7540163#M96085</link>
      <description>&lt;P&gt;I converted your version to VBA to test, and it worked fine for me. The one issue I did run into was that it crashed at that line if the dxfout.ini did not exist in the specified location. It doesn't hurt to add in the check to make sure that file exists as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Attached is the version so you can do your own testing using the VBA's environments better toolks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Sub Test()
    PublishDXF ("C:\Users\Public\Documents\test")
    Shell ("explorer.exe  C:\Users\Public\Documents")
End Sub

Public Sub PublishDXF(PathToSave As String)
    Dim DXFAddIn As TranslatorAddIn
    transID = "{C24E3AC4-122E-11D5-8E91-0010B541CD80}"
    Set DXFAddIn = ThisApplication.ApplicationAddIns.ItemById(transID)
    
    If DXFAddIn.Activated = False Then
         Call DXFAddIn.Activate
    End If

    Dim oDocument As Document
    Set oDocument = ThisApplication.ActiveDocument

    Dim oContext As TranslationContext
    Set oContext = ThisApplication.TransientObjects.CreateTranslationContext
    oContext.Type = IOMechanismEnum.kFileBrowseIOMechanism
    
    Dim oOptions As NameValueMap
    Set oOptions = ThisApplication.TransientObjects.CreateNameValueMap

    If DXFAddIn.HasSaveCopyAsOptions(oDocument, oContext, oOptions) Then
        Dim strIniFile As String
        strIniFile = "C:\temp\dxfout.ini"
        oOptions.Value("Export_Acad_IniFile") = strIniFile
    End If

    Dim oDataMedium As DataMedium
    Set oDataMedium = ThisApplication.TransientObjects.CreateDataMedium
    oDataMedium.FileName = PathToSave &amp;amp; ".dxf"

    Call DXFAddIn.SaveCopyAs(oDocument, oContext, oOptions, oDataMedium)
End Sub&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Nov 2017 18:26:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/export-idw-to-dxf/m-p/7540163#M96085</guid>
      <dc:creator>MechMachineMan</dc:creator>
      <dc:date>2017-11-13T18:26:58Z</dc:date>
    </item>
    <item>
      <title>Re: Export Idw to DXF</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/export-idw-to-dxf/m-p/7540636#M96086</link>
      <description>&lt;P&gt;I did try using&amp;nbsp;VBA. Just to double check I pasted your code into VBA and I get an error on the same line of code that says "Invalid procedure call or argument".&lt;/P&gt;
&lt;P&gt;Is there anyway to check what the values of the arguments should be?&lt;/P&gt;</description>
      <pubDate>Mon, 13 Nov 2017 21:28:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/export-idw-to-dxf/m-p/7540636#M96086</guid>
      <dc:creator>meck</dc:creator>
      <dc:date>2017-11-13T21:28:11Z</dc:date>
    </item>
    <item>
      <title>Re: Export Idw to DXF</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/export-idw-to-dxf/m-p/7540650#M96087</link>
      <description>&lt;P&gt;Did you double check the ini file and it's location?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What I would do is add a watch to the "oOptions", "oDataMedium", "oContext", and "oDocument" variables so that you can expand them in the watch window to double check that the value are actually assigned. If they all have values assigned as corresponds to your code, then it's either something to do with the location or wrong information assigned to them.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But before doing that, I would double check the ini location. If it exists there, I would export another ini file from inventor UI and then test the code with that version.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Nov 2017 21:33:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/export-idw-to-dxf/m-p/7540650#M96087</guid>
      <dc:creator>MechMachineMan</dc:creator>
      <dc:date>2017-11-13T21:33:25Z</dc:date>
    </item>
    <item>
      <title>Re: Export Idw to DXF</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/export-idw-to-dxf/m-p/7541779#M96088</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/2511355"&gt;@MechMachineMan&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;did your code work on a flat pattern? Not for me in Inventor 2018.1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I talked about DataIO because I think that's the way to export a flat pattern even thru UI (I mean, I don't know if internally Inventor uses TranslatorAddin or DataIO, but thru the UI File--&amp;gt;Export there isn't the dxf format but for drawing)&lt;/P&gt;</description>
      <pubDate>Tue, 14 Nov 2017 08:25:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/export-idw-to-dxf/m-p/7541779#M96088</guid>
      <dc:creator>CattabianiI</dc:creator>
      <dc:date>2017-11-14T08:25:40Z</dc:date>
    </item>
    <item>
      <title>Re: Export Idw to DXF</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/export-idw-to-dxf/m-p/7542529#M96089</link>
      <description>&lt;P&gt;I got it to finally work. The ini file was not being created, so I created one manually first and then ran the code. Worked perfectly. Was I suppose to do that in the first place?&lt;/P&gt;
&lt;P&gt;Thank you all for you generous help!&lt;/P&gt;</description>
      <pubDate>Tue, 14 Nov 2017 13:04:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/export-idw-to-dxf/m-p/7542529#M96089</guid>
      <dc:creator>meck</dc:creator>
      <dc:date>2017-11-14T13:04:38Z</dc:date>
    </item>
    <item>
      <title>Re: Export Idw to DXF</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/export-idw-to-dxf/m-p/7542551#M96090</link>
      <description>&lt;P&gt;Are you talking about the code that adds the text into the dxf file?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The DatatIO version of the code always worked for me, but was extremely slow when trying to add the text to the file. Using the PublishDXF code from the Inventor help example is easier for&amp;nbsp;to add the text and way faster.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Nov 2017 13:11:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/export-idw-to-dxf/m-p/7542551#M96090</guid>
      <dc:creator>meck</dc:creator>
      <dc:date>2017-11-14T13:11:20Z</dc:date>
    </item>
    <item>
      <title>Re: Export Idw to DXF</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/export-idw-to-dxf/m-p/7542701#M96091</link>
      <description>&lt;BLOCKQUOTE&gt;EDIT: sorry&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/57154"&gt;@meck&lt;/a&gt;&amp;nbsp;I misunderstood your original post, I thought you would work directly on the flat pattern of the ipt, without creating the drawing. Please ignore the following lines.&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/57154"&gt;@meck&lt;/a&gt; wrote:&lt;BR /&gt;&lt;P&gt;Are you talking about the code that adds the text into the dxf file?&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;I was talking about the code&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/2511355"&gt;@MechMachineMan&lt;/a&gt;&amp;nbsp;posted &lt;A href="https://forums.autodesk.com/t5/inventor-customization/export-idw-to-dxf/m-p/7540163#M76788" target="_blank"&gt;here&lt;/A&gt;, but if it works for you I'll be missing something somewhere, don't worry.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/57154"&gt;@meck&lt;/a&gt; wrote:&lt;BR /&gt;&lt;P&gt;The DataIO version of the code always worked for me, but was extremely slow when trying to add the text to the file. Using the PublishDXF code from the Inventor help example is easier for&amp;nbsp;to add the text and way faster.&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I don't really get this point,&amp;nbsp;how do you add the text with translatorAddin solution? Do you call EditDXFFile posted above after the dxf creation? If yes the performance should be the same. Or do you achieve your goal in another way, doing something before the&amp;nbsp;&lt;SPAN&gt;dxf creation?&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;By the way, you got a solution to your problem and that's what matters.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Nov 2017 14:14:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/export-idw-to-dxf/m-p/7542701#M96091</guid>
      <dc:creator>CattabianiI</dc:creator>
      <dc:date>2017-11-14T14:14:37Z</dc:date>
    </item>
    <item>
      <title>Re: Export Idw to DXF</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/export-idw-to-dxf/m-p/7542718#M96092</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3474788"&gt;@CattabianiI&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;From&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/57154"&gt;@meck&lt;/a&gt;'s code, it had looked like he was trying to work out the export using the drawing environment. Your method works for part files, but not drawing files AFAIK.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And yes meck, the .ini needs to be created before. It is your configured settings that the program imports to set it the specific settings (ie; ACAD export version, etc)&lt;/P&gt;</description>
      <pubDate>Tue, 14 Nov 2017 14:05:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/export-idw-to-dxf/m-p/7542718#M96092</guid>
      <dc:creator>MechMachineMan</dc:creator>
      <dc:date>2017-11-14T14:05:46Z</dc:date>
    </item>
    <item>
      <title>Re: Export Idw to DXF</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/export-idw-to-dxf/m-p/7542761#M96093</link>
      <description>&lt;P&gt;You're right I misunderstood the original post, sorry for adding comments not focused on the question.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Nov 2017 14:17:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/export-idw-to-dxf/m-p/7542761#M96093</guid>
      <dc:creator>CattabianiI</dc:creator>
      <dc:date>2017-11-14T14:17:54Z</dc:date>
    </item>
    <item>
      <title>Re: Export Idw to DXF</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/export-idw-to-dxf/m-p/7542866#M96094</link>
      <description>&lt;P&gt;Correct&amp;nbsp;MechMachineMan,&lt;/P&gt;
&lt;P&gt;I created the dxf directly from the ipt. I then edited the dxf file by changing the dxf to a txt file and adding the text to the text in the dxf file. I deleted the original dxf file and saved the new text with the text I added and changed the extension to a dxf.&lt;/P&gt;
&lt;P&gt;That all works. It truly did, but it took 2+ minutes to edit the text file because depending on the part the file could have 5000 lines in it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In my case I could not just add the text to the end of the text file, it had to be placed after the Entities of the part and before the end of the that section. As I said it was very slow.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there a document&amp;nbsp;somewhere stating how the ini file is formatted?&lt;/P&gt;
&lt;DIV class="popup-user-info expert-elite-user-popup"&gt;
&lt;DIV class="popup-username-rank"&gt;&lt;A class="pop-name" href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/2511355" target="_blank"&gt;&lt;U&gt;&lt;FONT color="#0066cc"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/U&gt;&lt;/A&gt;&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Tue, 14 Nov 2017 14:39:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/export-idw-to-dxf/m-p/7542866#M96094</guid>
      <dc:creator>meck</dc:creator>
      <dc:date>2017-11-14T14:39:37Z</dc:date>
    </item>
    <item>
      <title>Re: Export Idw to DXF</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/export-idw-to-dxf/m-p/7542907#M96095</link>
      <description>&lt;P&gt;Don't think so. BUT what you do is manually export a dxf, set the settings you like, and in the dxf export dialog box still, you can export a config file. This is the .ini file.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Nov 2017 14:49:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/export-idw-to-dxf/m-p/7542907#M96095</guid>
      <dc:creator>MechMachineMan</dc:creator>
      <dc:date>2017-11-14T14:49:29Z</dc:date>
    </item>
  </channel>
</rss>

