<?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: Inserting MText into .dwg in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/inserting-mtext-into-dwg/m-p/3762981#M51386</link>
    <description>&lt;P&gt;Hi, Alfred!&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class="hps"&gt;No need to install&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;VBA Enabler in order to read AutoCAD ActiveX Documentation.&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;It can be downloaded from &lt;A href="http://images.autodesk.com/adsk/files/autocad_2013_activex_help.zip" target="_blank"&gt;http://images.autodesk.com/adsk/files/autocad_2013_activex_help.zip&lt;/A&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 28 Jan 2013 09:57:01 GMT</pubDate>
    <dc:creator>Alexander.Rivilis</dc:creator>
    <dc:date>2013-01-28T09:57:01Z</dc:date>
    <item>
      <title>Inserting MText into .dwg</title>
      <link>https://forums.autodesk.com/t5/net-forum/inserting-mtext-into-dwg/m-p/3762837#M51384</link>
      <description>&lt;P&gt;Hello everyone!&lt;/P&gt;&lt;P&gt;I'm trying to make a small program in vb.net that creates are laser drawing. So far I was able to create the drawing from a part in inventor. The only left to do is to add the Part Number + description into this drawing. I'm really struggling on this one. I'm currently able to open the drawing and that's all. I've tried many things from examples I found on forums but it's not working. This is a sample of what I have regarding autocad in my program:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Imports Inventor&lt;BR /&gt;Imports System.IO&lt;BR /&gt;Imports AutoCAD&lt;BR /&gt;Imports Autodesk.AutoCAD.Runtime&lt;BR /&gt;Imports Autodesk.AutoCAD.EditorInput&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Private Sub OpenDrawing()&lt;BR /&gt;Dim oACAD As New Object&lt;/P&gt;&lt;P&gt;Dim oMtext As AcadMText&lt;BR /&gt;oACAD = CreateObject("AutoCAD.Application")&lt;BR /&gt;oACAD.visible = True&lt;BR /&gt;oACAD.Documents.Open(fileNameAndPath, False)&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 14px;"&gt;End Sub&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 14px;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 14px;"&gt;I need to find a way to add Mtext but I don't find anything that I'm able to use in my program. If any of you know a good reference, or have a sample of code I would really appreciate it.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 14px;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 14px;"&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 14px;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 14px;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Jan 2013 03:41:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/inserting-mtext-into-dwg/m-p/3762837#M51384</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-01-28T03:41:05Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting MText into .dwg</title>
      <link>https://forums.autodesk.com/t5/net-forum/inserting-mtext-into-dwg/m-p/3762972#M51385</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;as you are working from an external EXE /APP (otherwise you would not have to create the AutoCAD-object and so start the application) you only can use COM/ActiveX for communication to the AcadApplication-instance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And as long as you use VB.NET and COM your best help might be to look to the VBA-internal help as it's quite similar (same object model). So install the VBA-Enabler (be careful, some guys have measured timing conflicts just because it is installed) and look to this help.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;In case of MTEXT you'll find that:&lt;/P&gt;&lt;PRE&gt;Sub Example_AddMtext()
    ' This example creates an MText object in model space.
    
    Dim MTextObj As AcadMText
    Dim corner(0 To 2) As Double
    Dim width As Double
    Dim text As String
    corner(0) = 0#: corner(1) = 10#: corner(2) = 0#
    width = 10
    text = "This is the text String for the mtext Object"

    ' Creates the mtext Object
    Set MTextObj = ThisDrawing.ModelSpace.AddMText(corner, width, text)
    ZoomAll
    
End Sub&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;HTH, - alfred -&lt;/P&gt;</description>
      <pubDate>Mon, 28 Jan 2013 09:36:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/inserting-mtext-into-dwg/m-p/3762972#M51385</guid>
      <dc:creator>Alfred.NESWADBA</dc:creator>
      <dc:date>2013-01-28T09:36:40Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting MText into .dwg</title>
      <link>https://forums.autodesk.com/t5/net-forum/inserting-mtext-into-dwg/m-p/3762981#M51386</link>
      <description>&lt;P&gt;Hi, Alfred!&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class="hps"&gt;No need to install&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;VBA Enabler in order to read AutoCAD ActiveX Documentation.&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;It can be downloaded from &lt;A href="http://images.autodesk.com/adsk/files/autocad_2013_activex_help.zip" target="_blank"&gt;http://images.autodesk.com/adsk/files/autocad_2013_activex_help.zip&lt;/A&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Jan 2013 09:57:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/inserting-mtext-into-dwg/m-p/3762981#M51386</guid>
      <dc:creator>Alexander.Rivilis</dc:creator>
      <dc:date>2013-01-28T09:57:01Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting MText into .dwg</title>
      <link>https://forums.autodesk.com/t5/net-forum/inserting-mtext-into-dwg/m-p/3762982#M51387</link>
      <description>&lt;P&gt;Hi Alexander,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Much appreciated!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Where do you get that info's from?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have you got a list of files where to download what from Autodesk? I would like to have the link to the source-code!&lt;IMG src="http://www.smiliemania.de/smilie132/00008359.gif" alt="animierte smilies lachen grinsen happy freuen smilen witzig froh" title="animierte smilies lachen grinsen happy freuen smilen witzig froh" border="0" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- alfred -&lt;/P&gt;</description>
      <pubDate>Mon, 28 Jan 2013 10:04:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/inserting-mtext-into-dwg/m-p/3762982#M51387</guid>
      <dc:creator>Alfred.NESWADBA</dc:creator>
      <dc:date>2013-01-28T10:04:10Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting MText into .dwg</title>
      <link>https://forums.autodesk.com/t5/net-forum/inserting-mtext-into-dwg/m-p/3762984#M51388</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;alfred.neswadba wrote: &lt;BR /&gt;
&lt;P&gt;... Where do you get that info's from? ...&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;A href="http://hyperpics.blogs.com/beyond_the_ui/2012/09/updated-autocad-2013-activex-developer-documentation.html" target="_blank"&gt;http://hyperpics.blogs.com/beyond_the_ui/2012/09/updated-autocad-2013-activex-developer-documentation.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/389680"&gt;@Alfred.NESWADBA&lt;/a&gt; wrote:&lt;BR /&gt;&lt;BR /&gt;
&lt;P&gt;...Have you got a list of files where to download what from Autodesk? I would like to have the link to the source-code!&lt;IMG src="http://www.smiliemania.de/smilie132/00008359.gif" border="0" alt="animierte smilies lachen grinsen happy freuen smilen witzig froh" title="animierte smilies lachen grinsen happy freuen smilen witzig froh" /&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN class="short_text"&gt;&lt;SPAN class="hps gt-trans-draggable"&gt;Oh!&lt;/SPAN&gt; &lt;SPAN class="hps alt-edited gt-trans-draggable"&gt;I also want&lt;/SPAN&gt; &lt;SPAN class="hps alt-edited gt-trans-draggable"&gt;a&lt;/SPAN&gt; &lt;SPAN class="hps gt-trans-draggable"&gt;list of &lt;SPAN class="short_text"&gt;&lt;SPAN class="hps alt-edited gt-trans-draggable"&gt;such &lt;/SPAN&gt;&lt;/SPAN&gt;files.&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://forums.autodesk.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Jan 2013 10:10:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/inserting-mtext-into-dwg/m-p/3762984#M51388</guid>
      <dc:creator>Alexander.Rivilis</dc:creator>
      <dc:date>2013-01-28T10:10:12Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting MText into .dwg</title>
      <link>https://forums.autodesk.com/t5/net-forum/inserting-mtext-into-dwg/m-p/3763708#M51389</link>
      <description>&lt;P&gt;here is the code I use in my vb.net program by the way:&lt;/P&gt;&lt;P&gt;Dim oACAD As New Object&lt;BR /&gt;Dim oMtext As AutoCAD.AcadMText&lt;BR /&gt;Dim corner(0 To 2) As Double&lt;BR /&gt;Dim width As Double = 10&lt;BR /&gt;Dim Text As String&lt;BR /&gt;Dim XPosition As Double = (-width / 2) + (PartLength / 2)&lt;BR /&gt;Dim YPosition As Double = -0.25&lt;/P&gt;&lt;P&gt;corner(0) = XPosition# : corner(1) = YPosition# : corner(2) = 0.0#&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Text = "{\fTahoma|b0|i0|c0|p34;\L\C3DWG #" &amp;amp; txtNomLaser.Text &amp;amp; "\l\P\C3MATL: " &amp;amp; DescriptionPiece &amp;amp; "\P\C3QTY:____}"&lt;/P&gt;&lt;P&gt;oACAD = CreateObject("AutoCAD.Application")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;oACAD.visible = False&lt;BR /&gt;lblStatus.Text = "Ouverture d'Autocad en cours..."&lt;BR /&gt;oACAD.Documents.Open(fileNameAndPath, False)&lt;BR /&gt;Retry = 0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dim oDoc As AutoCAD.AcadDocument&lt;BR /&gt;oDoc = oACAD.ActiveDocument&lt;BR /&gt;lblStatus.Text = "Création des layers en cours..."&lt;BR /&gt;Dim LayerText As AutoCAD.AcadLayer = oDoc.Layers.Add("Text")&lt;BR /&gt;lblStatus.Text = "Ajout du texte dans le DWG en cours..."&lt;BR /&gt;oMtext = oDoc.ModelSpace.AddMText(corner, width, Text)&lt;/P&gt;&lt;P&gt;oMtext.AttachmentPoint = AcAttachmentPoint.acAttachmentPointTopCenter&lt;BR /&gt;oMtext.Layer = LayerText.Name.ToString&lt;BR /&gt;lblStatus.Text = "Sauvegarde du fichier"&lt;BR /&gt;oDoc.Save()&lt;/P&gt;&lt;P&gt;lblStatus.Text = "Fermeture d'Autocad"&lt;BR /&gt;oACAD.Quit()&lt;BR /&gt;oACAD = Nothing&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much for your help!&lt;/P&gt;</description>
      <pubDate>Tue, 29 Jan 2013 00:49:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/inserting-mtext-into-dwg/m-p/3763708#M51389</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-01-29T00:49:42Z</dc:date>
    </item>
  </channel>
</rss>

