<?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: Text Explode in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/text-explode/m-p/11554033#M11080</link>
    <description>&lt;P&gt;It is difficult to understand what your ultimate goal is? Are you trying to simply mirror text? Explode text? Why export only to import right away? I would like to offer my help but need to know more about what you are trying to do.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 15 Nov 2022 16:37:11 GMT</pubDate>
    <dc:creator>hippe013</dc:creator>
    <dc:date>2022-11-15T16:37:11Z</dc:date>
    <item>
      <title>Text Explode</title>
      <link>https://forums.autodesk.com/t5/net-forum/text-explode/m-p/11532039#M11072</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to write a routine to explode text but I've had some issues code is below.&lt;/P&gt;&lt;P&gt;The issue is that when I export/import the WMF I don't believe it's doing this on the mirrored entity.&lt;/P&gt;&lt;P&gt;I've tried many different ways but I can't seem to get the wmf import/export to work on the mirrored entity.&lt;/P&gt;&lt;P&gt;I was also wondering if there's a better way for me to create the line to mirror the entity right now the entity ends up very far from the original when I'd like it to be mirrored beside so I can mirror it back.&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;LI-CODE lang="general"&gt;  Public Shared Sub TextExplode(ent As Entity)
    Dim doc As Document = Application.DocumentManager.MdiActiveDocument
    Dim db As Database = doc.Database
    Dim ed As Editor = doc.Editor
    Dim acadSel As AcadSelectionSet = Nothing

    Try
      ' Open application and document
      Dim acadApp As AcadApplication = Application.AcadApplication
      Dim acadDoc As AcadDocument = acadApp.ActiveDocument

      Application.SetSystemVariable("MIRRTEXT", 1)
      ' Mirror text
      'ed.Command("MIRROR", ent.ObjectId, "", Point3d.Origin, "", New Point3d(0, 1, 0), "", "y", "")
      Dim MirrorAxis As New Line3d(Point3d.Origin, New Point3d(0.0,
                                                               1.0,
                                                               0.0))
      Dim transform As Matrix3d = Matrix3d.Mirroring(MirrorAxis)
      ent.TransformBy(transform)

      Dim insPoint As Point3d = Point3d.Origin
      If TypeOf ent Is DBText Then
        Dim parent As DBText = CType(ent, DBText)
        insPoint = parent.Position
      ElseIf TypeOf ent Is MText Then
        Dim parent As MText = CType(ent, MText)
        insPoint = parent.Location
      ElseIf TypeOf ent Is BlockReference Then
        Dim parent As BlockReference = CType(ent, BlockReference)
        insPoint = parent.Position
      End If

      ' Create entity array
      Dim acadEnt(0) As AcadEntity
      acadEnt(0) = CType(ent.AcadObject, AcadEntity)

      ' Create selection set with entity
      acadSel = acadDoc.SelectionSets.Add("SS1")
      acadSel.AddItems(acadEnt)

      ' Export to WMF
      Dim tempPath As String = String.Concat(IO.Path.GetTempPath(), "txtexp")
      acadDoc.Export(tempPath, "WMF", acadSel)

      ' Import WMF
      Dim pt As Double() = New Double() {insPoint.X, insPoint.Y, insPoint.Z}
      acadDoc.Import(String.Concat(System.IO.Path.GetTempPath(), "txtexp.wmf"), CType(pt, Object), 1.0)

    Catch ex As Exception
      ReportError(ex)
    Finally
      If acadSel IsNot Nothing Then acadSel.Delete()
    End Try
  End Sub&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Nov 2022 21:45:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/text-explode/m-p/11532039#M11072</guid>
      <dc:creator>WonkaPet</dc:creator>
      <dc:date>2022-11-04T21:45:12Z</dc:date>
    </item>
    <item>
      <title>Re: Text Explode</title>
      <link>https://forums.autodesk.com/t5/net-forum/text-explode/m-p/11532356#M11073</link>
      <description>&lt;P&gt;Seems like my issue is that I'm not able to export the transformed entity.&lt;/P&gt;&lt;P&gt;I keep exporting the entity before the transform.&lt;BR /&gt;Is there a way to apply the transform before the export? Or do I need to put the transform in it's own transaction and commit that before doing the wmf export/import?&lt;/P&gt;</description>
      <pubDate>Sat, 05 Nov 2022 03:20:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/text-explode/m-p/11532356#M11073</guid>
      <dc:creator>WonkaPet</dc:creator>
      <dc:date>2022-11-05T03:20:45Z</dc:date>
    </item>
    <item>
      <title>Re: Text Explode</title>
      <link>https://forums.autodesk.com/t5/net-forum/text-explode/m-p/11532564#M11074</link>
      <description>&lt;P&gt;HI &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6738015"&gt;@WonkaPet&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;MAYBE THIS HELP YOU&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.theswamp.org/index.php?topic=14906.0" target="_blank"&gt;https://www.theswamp.org/index.php?topic=14906.0&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 05 Nov 2022 07:47:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/text-explode/m-p/11532564#M11074</guid>
      <dc:creator>hosneyalaa</dc:creator>
      <dc:date>2022-11-05T07:47:17Z</dc:date>
    </item>
    <item>
      <title>Re: Text Explode</title>
      <link>https://forums.autodesk.com/t5/net-forum/text-explode/m-p/11533662#M11075</link>
      <description>&lt;P&gt;Thanks for the link for some reason I'm still only modifying the text pre transform. Not sure what the issue is here...&lt;/P&gt;</description>
      <pubDate>Sun, 06 Nov 2022 03:06:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/text-explode/m-p/11533662#M11075</guid>
      <dc:creator>WonkaPet</dc:creator>
      <dc:date>2022-11-06T03:06:44Z</dc:date>
    </item>
    <item>
      <title>Re: Text Explode</title>
      <link>https://forums.autodesk.com/t5/net-forum/text-explode/m-p/11537117#M11076</link>
      <description>&lt;P&gt;Maybe to get around this all is there anyway to call the TXTEXP command synchronously?&lt;BR /&gt;I want to be able to put the command in a loop and call it on different entities and then work with the exploded entities after the command is called.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;When I try Editor.Command with TXTEXP I get eInvalidInput.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Nov 2022 22:09:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/text-explode/m-p/11537117#M11076</guid>
      <dc:creator>WonkaPet</dc:creator>
      <dc:date>2022-11-07T22:09:52Z</dc:date>
    </item>
    <item>
      <title>Re: Text Explode</title>
      <link>https://forums.autodesk.com/t5/net-forum/text-explode/m-p/11541264#M11077</link>
      <description>&lt;P&gt;Still looking for some help in the topic thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 09 Nov 2022 15:43:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/text-explode/m-p/11541264#M11077</guid>
      <dc:creator>WonkaPet</dc:creator>
      <dc:date>2022-11-09T15:43:30Z</dc:date>
    </item>
    <item>
      <title>Re: Text Explode</title>
      <link>https://forums.autodesk.com/t5/net-forum/text-explode/m-p/11544004#M11078</link>
      <description>&lt;P&gt;Bump&lt;/P&gt;</description>
      <pubDate>Thu, 10 Nov 2022 15:39:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/text-explode/m-p/11544004#M11078</guid>
      <dc:creator>WonkaPet</dc:creator>
      <dc:date>2022-11-10T15:39:19Z</dc:date>
    </item>
    <item>
      <title>Re: Text Explode</title>
      <link>https://forums.autodesk.com/t5/net-forum/text-explode/m-p/11552019#M11079</link>
      <description>&lt;P&gt;Bump&lt;/P&gt;</description>
      <pubDate>Mon, 14 Nov 2022 21:09:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/text-explode/m-p/11552019#M11079</guid>
      <dc:creator>WonkaPet</dc:creator>
      <dc:date>2022-11-14T21:09:28Z</dc:date>
    </item>
    <item>
      <title>Re: Text Explode</title>
      <link>https://forums.autodesk.com/t5/net-forum/text-explode/m-p/11554033#M11080</link>
      <description>&lt;P&gt;It is difficult to understand what your ultimate goal is? Are you trying to simply mirror text? Explode text? Why export only to import right away? I would like to offer my help but need to know more about what you are trying to do.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Nov 2022 16:37:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/text-explode/m-p/11554033#M11080</guid>
      <dc:creator>hippe013</dc:creator>
      <dc:date>2022-11-15T16:37:11Z</dc:date>
    </item>
    <item>
      <title>Re: Text Explode</title>
      <link>https://forums.autodesk.com/t5/net-forum/text-explode/m-p/11554280#M11081</link>
      <description>&lt;P&gt;Hi there&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1633394"&gt;@hippe013&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am attempting to recreate AutoCAD's native TXTEXP routine in code because I'm unable to run it synchronously.&lt;/P&gt;&lt;P&gt;My goal is to be able to loop through multiple text entities and explode them but still work with the exploded entities and know which text item they are associated with.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the code I have right now I need to mirror the text and then export to WMF which makes it so when I import the entities back in they import as lines. If I export/import the original entity I can't get the import to be lines. This is also the method that the TXTEXP express tool uses to explode text. After that I will mirror the text entities back. I have kind of veered from this approach now because the imported entities are not scaled correctly and I'm not sure how to get them to scale correctly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm in search of any solution in code that would allow me to explode the text in place so I can work with the resultants.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not able to directly call the TXTEXP routine to do this because I get an error when trying to call the command synchronously.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The closest solution that I've come across is here:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.keanw.com/2014/01/exploding-autocad-text-and-manipulating-the-results-using-net.html" target="_blank"&gt;https://www.keanw.com/2014/01/exploding-autocad-text-and-manipulating-the-results-using-net.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But the way it works doesn't allow me to work with groups of text.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Nov 2022 18:17:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/text-explode/m-p/11554280#M11081</guid>
      <dc:creator>WonkaPet</dc:creator>
      <dc:date>2022-11-15T18:17:29Z</dc:date>
    </item>
    <item>
      <title>Re: Text Explode</title>
      <link>https://forums.autodesk.com/t5/net-forum/text-explode/m-p/11554624#M11082</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6738015"&gt;@WonkaPet&lt;/a&gt;, you have a very interesting and challenging problem here. I ran a few tests of my own and found some confusing results. Might I suggest not using AutoCAD's import and use a wmf library instead? Might have more control over the geometry of the lines (polylines / curves) coming back in. I found the following on Github.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/papnkukn/wmf" target="_blank" rel="noopener"&gt;https://github.com/papnkukn/wmf&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Nov 2022 20:27:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/text-explode/m-p/11554624#M11082</guid>
      <dc:creator>hippe013</dc:creator>
      <dc:date>2022-11-15T20:27:26Z</dc:date>
    </item>
    <item>
      <title>Re: Text Explode</title>
      <link>https://forums.autodesk.com/t5/net-forum/text-explode/m-p/11554626#M11083</link>
      <description>&lt;P&gt;Well, now that Kean's approach (calling "TxtExp" with SendStringToExecute with a PickFirst selection (using Editor.SetImpliedSelection()) works, you can certainly do it by one text being selected at a time in a loop.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;By "loop" here, I do not mean a For... loop within a command. Rather, you can use CommandEnded handler to continuously do the text exploding with SendStringToExecute() until all target texts are processed (you can store all target texts' Id in a static/class level collection, so that you can access them during the loop).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope you get the idea and give it a try. I might be able to try it too, but am a bit busy to find time right now.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Nov 2022 20:28:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/text-explode/m-p/11554626#M11083</guid>
      <dc:creator>norman.yuan</dc:creator>
      <dc:date>2022-11-15T20:28:24Z</dc:date>
    </item>
    <item>
      <title>Re: Text Explode</title>
      <link>https://forums.autodesk.com/t5/net-forum/text-explode/m-p/11554641#M11084</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1633394"&gt;@hippe013&lt;/a&gt;I might try looking into that if I'm at wit's end thank you.&lt;BR /&gt;&lt;BR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/543921"&gt;@norman.yuan&lt;/a&gt;The 2nd part of your comment might be the solution I need. Initially when I used Kean's code the resultants would be a bunch of lines with no real grouping. I'd be able to explode multiple pieces of text but not be able to associate the text. My goal is to be able to make a block with the lines to put with the text but I don't want one big block with all pieces of text.&lt;BR /&gt;&lt;BR /&gt;I'm a bit confused by the loop you mention though which command ended event would I be attaching to?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;My end goal is to be able to mimic halo text behind all my text by changing the width of the lines that are generated. I'm not sure if there's a better way to do this but compared to the other resources I've found it seems to be the most reliable.&lt;BR /&gt;&lt;BR /&gt;TIA&lt;/P&gt;</description>
      <pubDate>Tue, 15 Nov 2022 20:38:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/text-explode/m-p/11554641#M11084</guid>
      <dc:creator>WonkaPet</dc:creator>
      <dc:date>2022-11-15T20:38:40Z</dc:date>
    </item>
    <item>
      <title>Re: Text Explode</title>
      <link>https://forums.autodesk.com/t5/net-forum/text-explode/m-p/11560482#M11085</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6738015"&gt;@WonkaPet&lt;/a&gt;&amp;nbsp;, how is your exploration for the solution of exploding texts individually going? After I suggested a possible solution, I finally found a bit of time to write some code to confirm what I suggested can do what you want pretty well. As usual, I post entire runnable code in my blog:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://drive-cad-with-code.blogspot.com/2022/11/loop-operation-with-sendstringtoexecute.html" target="_blank" rel="noopener"&gt;https://drive-cad-with-code.blogspot.com/2022/11/loop-operation-with-sendstringtoexecute.html&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope it helps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Nov 2022 21:11:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/text-explode/m-p/11560482#M11085</guid>
      <dc:creator>norman.yuan</dc:creator>
      <dc:date>2022-11-17T21:11:11Z</dc:date>
    </item>
    <item>
      <title>Re: Text Explode</title>
      <link>https://forums.autodesk.com/t5/net-forum/text-explode/m-p/11560989#M11086</link>
      <description>&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/543921"&gt;@norman.yuan&lt;/a&gt;, thank you so much again. I had given up for a moment because I exhausted all ideas but the solution you provided on your blog worked exactly how I needed it to. Thank you!</description>
      <pubDate>Fri, 18 Nov 2022 02:55:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/text-explode/m-p/11560989#M11086</guid>
      <dc:creator>WonkaPet</dc:creator>
      <dc:date>2022-11-18T02:55:34Z</dc:date>
    </item>
  </channel>
</rss>

