<?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 Open DXF and add Text using external application with AutoCAD in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/open-dxf-and-add-text-using-external-application-with-autocad/m-p/3244986#M58178</link>
    <description>&lt;P&gt;Hi I have been doing a bit of programming with Visul Studio 2010 (VB) with Inventor and created a number of small standalone applications doing tasks like printing drawings and exporting properties etc.&lt;/P&gt;&lt;P&gt;I am now busy with writing a program exporting all the flat patterns of all the sheet metal parts in an Inventor assembly. I got it right and it works pretty well but now need to add some text to the DXF file. I want to add things like QTY, Thickness and Material to the file. I turned to google and started searching the web just to find that there are a load of nice DXF modules available at a huge cost. Not worth it for a small once off application like this. Anyway then I though that maybe AutoCAD has something I can use as AutoCAD can be available on the PC I will be running the app from.&lt;/P&gt;&lt;P&gt;So does anyone know if this would be possible using VB.net with AutoCAD API with a standalone application, to open a DWG or DXF file created by Inventor and to add a few lines of text and to save it again?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Pieter&lt;/P&gt;</description>
    <pubDate>Wed, 30 Nov 2011 19:19:52 GMT</pubDate>
    <dc:creator>Raider_71</dc:creator>
    <dc:date>2011-11-30T19:19:52Z</dc:date>
    <item>
      <title>Open DXF and add Text using external application with AutoCAD</title>
      <link>https://forums.autodesk.com/t5/net-forum/open-dxf-and-add-text-using-external-application-with-autocad/m-p/3244986#M58178</link>
      <description>&lt;P&gt;Hi I have been doing a bit of programming with Visul Studio 2010 (VB) with Inventor and created a number of small standalone applications doing tasks like printing drawings and exporting properties etc.&lt;/P&gt;&lt;P&gt;I am now busy with writing a program exporting all the flat patterns of all the sheet metal parts in an Inventor assembly. I got it right and it works pretty well but now need to add some text to the DXF file. I want to add things like QTY, Thickness and Material to the file. I turned to google and started searching the web just to find that there are a load of nice DXF modules available at a huge cost. Not worth it for a small once off application like this. Anyway then I though that maybe AutoCAD has something I can use as AutoCAD can be available on the PC I will be running the app from.&lt;/P&gt;&lt;P&gt;So does anyone know if this would be possible using VB.net with AutoCAD API with a standalone application, to open a DWG or DXF file created by Inventor and to add a few lines of text and to save it again?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Pieter&lt;/P&gt;</description>
      <pubDate>Wed, 30 Nov 2011 19:19:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/open-dxf-and-add-text-using-external-application-with-autocad/m-p/3244986#M58178</guid>
      <dc:creator>Raider_71</dc:creator>
      <dc:date>2011-11-30T19:19:52Z</dc:date>
    </item>
    <item>
      <title>Re: Open DXF and add Text using external application with AutoCAD</title>
      <link>https://forums.autodesk.com/t5/net-forum/open-dxf-and-add-text-using-external-application-with-autocad/m-p/3245696#M58179</link>
      <description>&lt;P&gt;You can do this with and without AutoCAD. Search this forum for samples loading DXF from within AutoCAD.&lt;/P&gt;&lt;P&gt;You could do this without AutoCAD as well because ths DXF structure is still easy to decode.&lt;/P&gt;&lt;P&gt;Open a new AutoCAD drawing, Add one line of text, saveas DXF.&lt;/P&gt;&lt;P&gt;Open the DXF file using Notepad, search for ENTITIES. The lines between&amp;nbsp; 0 up to the next 0 describes the text entity.&lt;/P&gt;&lt;P&gt;Insert this block in youre inventor dxf file, and change de line after 10 with the new X coordinate, after 20 with the new Y coordinate and after 1 with the new stringdata&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SECTION&lt;BR /&gt;&amp;nbsp; 2&lt;BR /&gt;ENTITIES&lt;BR /&gt;&amp;nbsp; 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;---- start of (MTEXT) entity&lt;BR /&gt;MTEXT&lt;BR /&gt;&amp;nbsp; 5&lt;BR /&gt;21F&lt;BR /&gt;330&lt;BR /&gt;1F&lt;BR /&gt;100&lt;BR /&gt;AcDbEntity&lt;BR /&gt;&amp;nbsp; 8&lt;BR /&gt;0&lt;BR /&gt;100&lt;BR /&gt;AcDbMText&lt;BR /&gt;&amp;nbsp;10&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;---- X-coordinate&lt;BR /&gt;100.0&lt;BR /&gt;&amp;nbsp;20&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;---- Y coordinate&lt;BR /&gt;150.0&lt;BR /&gt;&amp;nbsp;30&lt;BR /&gt;0.0&lt;BR /&gt;&amp;nbsp;40&lt;BR /&gt;2.5&lt;BR /&gt;&amp;nbsp;41&lt;BR /&gt;0.0&lt;BR /&gt;&amp;nbsp;46&lt;BR /&gt;0.0&lt;BR /&gt;&amp;nbsp;71&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;BR /&gt;&amp;nbsp;72&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5&lt;BR /&gt;&amp;nbsp; 1&lt;BR /&gt;Hello world&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;stringdata&lt;BR /&gt;&amp;nbsp;73&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;BR /&gt;&amp;nbsp;44&lt;BR /&gt;1.0&lt;BR /&gt;&amp;nbsp; 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;-- start of next entity&lt;BR /&gt;ENDSEC&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Dec 2011 08:02:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/open-dxf-and-add-text-using-external-application-with-autocad/m-p/3245696#M58179</guid>
      <dc:creator>SENL1362</dc:creator>
      <dc:date>2011-12-01T08:02:38Z</dc:date>
    </item>
    <item>
      <title>Re: Open DXF and add Text using external application with AutoCAD</title>
      <link>https://forums.autodesk.com/t5/net-forum/open-dxf-and-add-text-using-external-application-with-autocad/m-p/3246506#M58180</link>
      <description>&lt;P&gt;Thank you for the help. I will follow the manual way. it looks easier.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Pieter&lt;/P&gt;</description>
      <pubDate>Thu, 01 Dec 2011 17:17:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/open-dxf-and-add-text-using-external-application-with-autocad/m-p/3246506#M58180</guid>
      <dc:creator>Raider_71</dc:creator>
      <dc:date>2011-12-01T17:17:58Z</dc:date>
    </item>
    <item>
      <title>Re: Open DXF and add Text using external application with AutoCAD</title>
      <link>https://forums.autodesk.com/t5/net-forum/open-dxf-and-add-text-using-external-application-with-autocad/m-p/5376175#M58181</link>
      <description>&lt;P&gt;Hey I am trying to do something similar but am getting issues with the finished dxf.&lt;/P&gt;&lt;P&gt;I get invlaid or incomplete dxf when trying to open in Acad.&lt;/P&gt;&lt;P&gt;I have been trying to get my head around the dxf group codes and how they work with no success.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;At the moment my code deletes the last three lines of the dxf file:&lt;/P&gt;&lt;P&gt;ENDSEC&lt;/P&gt;&lt;P&gt;0&lt;/P&gt;&lt;P&gt;EOF&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;then adds my text entity:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;'String to insert at the end of the text file
sText = "  0" &amp;amp; vbNewLine
sText = sText &amp;amp; "TEXT" &amp;amp; vbNewLine  'text entity
sText = sText &amp;amp; " 11" &amp;amp; vbNewLine    'group code -x location
sText = sText &amp;amp; cX &amp;amp; vbNewLine      'x location
sText = sText &amp;amp; " 21" &amp;amp; vbNewLine    'group code - y location
sText = sText &amp;amp; cY &amp;amp; vbNewLine      'y location
sText = sText &amp;amp; " 40" &amp;amp; vbNewLine    'group code -text height
sText = sText &amp;amp; " 30" &amp;amp; vbNewLine    'text size
sText = sText &amp;amp; " 72" &amp;amp; vbNewLine    'group code -horizontal text justification
sText = sText &amp;amp; "  1" &amp;amp; vbNewLine     'centred text
sText = sText &amp;amp; "  1" &amp;amp; vbNewLine     'group code - string itself
sText = sText &amp;amp; oPartNumberValue &amp;amp; vbNewLine 'part number
sText = sText &amp;amp; "ENDSEC" &amp;amp; vbNewLine
sText = sText &amp;amp; "  0" &amp;amp; vbNewLine
sText = sText &amp;amp; "EOF" &amp;amp; vbNewLine

    objFile.WriteLine sText
objFile.Close&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be awsome!!&amp;nbsp;&lt;/P&gt;&lt;P&gt;cheers&lt;/P&gt;</description>
      <pubDate>Mon, 03 Nov 2014 02:58:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/open-dxf-and-add-text-using-external-application-with-autocad/m-p/5376175#M58181</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-11-03T02:58:20Z</dc:date>
    </item>
    <item>
      <title>Re: Open DXF and add Text using external application with AutoCAD</title>
      <link>https://forums.autodesk.com/t5/net-forum/open-dxf-and-add-text-using-external-application-with-autocad/m-p/5376329#M58182</link>
      <description>&lt;P&gt;Dxf lines comes in pairs of two, first&amp;nbsp;line an integer, second line data depending, which type depent on the value of the first line.&lt;/P&gt;&lt;P&gt;you remove 3 lines, therefore let the first line of the SECTION pair in the file, i.e.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SECTION &amp;nbsp; &amp;nbsp; 2e line&lt;/P&gt;&lt;P&gt;0 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1e line&lt;/P&gt;&lt;P&gt;EOF &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2e line&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So you should remove one more line, then insert you're TEXT object.&lt;/P&gt;&lt;P&gt;Then at the end insert the FOUR lines again:&lt;/P&gt;&lt;P&gt;0&lt;/P&gt;&lt;P&gt;SECTION&lt;/P&gt;&lt;P&gt;0&lt;/P&gt;&lt;P&gt;EOF&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then i think the pairs for the code 72is not correct.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Lastely you can insert the TEXT object in the ENTITIES section (and Block sections) but not in other sections. modern versions of DXF files are more complicated and their last section is probably not ENTITIES and thus inserting TEXT just before the last 4 sections may not be correct.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Nov 2014 07:24:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/open-dxf-and-add-text-using-external-application-with-autocad/m-p/5376329#M58182</guid>
      <dc:creator>SENL1362</dc:creator>
      <dc:date>2014-11-03T07:24:12Z</dc:date>
    </item>
    <item>
      <title>Re: Open DXF and add Text using external application with AutoCAD</title>
      <link>https://forums.autodesk.com/t5/net-forum/open-dxf-and-add-text-using-external-application-with-autocad/m-p/5378163#M58183</link>
      <description>&lt;P&gt;Cheers for the reply. In terms of version of DXF, I&amp;nbsp;can export from inventor in 2010,2007,2004,2000 or R12.&lt;/P&gt;&lt;P&gt;I dont think it matters for my nesting software which DXF format I use, is one of these easiest/prefered that you know of?&lt;/P&gt;&lt;P&gt;I will try now with 2000 as this seems oldest and hopefully most simple.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am looking at a list of group codes on the autodesk website,&lt;/P&gt;&lt;P&gt;&lt;A target="_blank" href="http://www.autodesk.com/techpubs/autocad/acadr14/dxf/text_al_u05_c.htm"&gt;http://www.autodesk.com/techpubs/autocad/acadr14/dxf/text_al_u05_c.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;It states group code 72 is for horizonal text justification.&lt;/P&gt;&lt;P&gt;Do these group codes change with different DXF versions?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 03 Nov 2014 19:25:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/open-dxf-and-add-text-using-external-application-with-autocad/m-p/5378163#M58183</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-11-03T19:25:03Z</dc:date>
    </item>
    <item>
      <title>Re: Open DXF and add Text using external application with AutoCAD</title>
      <link>https://forums.autodesk.com/t5/net-forum/open-dxf-and-add-text-using-external-application-with-autocad/m-p/5378277#M58184</link>
      <description>The most early version, R12 will do for simple drawings.&lt;BR /&gt;After more detailed look the 72 code appears to be ok, and normally codes don't change.&lt;BR /&gt;Good luck.&lt;BR /&gt;</description>
      <pubDate>Mon, 03 Nov 2014 20:07:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/open-dxf-and-add-text-using-external-application-with-autocad/m-p/5378277#M58184</guid>
      <dc:creator>SENL1362</dc:creator>
      <dc:date>2014-11-03T20:07:52Z</dc:date>
    </item>
    <item>
      <title>Re: Open DXF and add Text using external application with AutoCAD</title>
      <link>https://forums.autodesk.com/t5/net-forum/open-dxf-and-add-text-using-external-application-with-autocad/m-p/5378285#M58185</link>
      <description>&lt;P&gt;I think I have found the problem there are some group codes that are NOT optional that i was ommiting such as layer etc.&lt;/P&gt;&lt;P&gt;Once I add these and use R12 format it works perfectly!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Nov 2014 20:09:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/open-dxf-and-add-text-using-external-application-with-autocad/m-p/5378285#M58185</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-11-03T20:09:28Z</dc:date>
    </item>
    <item>
      <title>Re: Open DXF and add Text using external application with AutoCAD</title>
      <link>https://forums.autodesk.com/t5/net-forum/open-dxf-and-add-text-using-external-application-with-autocad/m-p/5378325#M58186</link>
      <description>also be aware of empty textstrings</description>
      <pubDate>Mon, 03 Nov 2014 20:23:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/open-dxf-and-add-text-using-external-application-with-autocad/m-p/5378325#M58186</guid>
      <dc:creator>SENL1362</dc:creator>
      <dc:date>2014-11-03T20:23:21Z</dc:date>
    </item>
  </channel>
</rss>

