<?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: How to Crate Mtext and visible with the cursor, &amp;amp; exit when escape in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/how-to-crate-mtext-and-visible-with-the-cursor-amp-exit-when/m-p/7681763#M28147</link>
    <description>&lt;P&gt;Please see the snap for the code [Mtexts]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 11 Jan 2018 10:54:30 GMT</pubDate>
    <dc:creator>kite15</dc:creator>
    <dc:date>2018-01-11T10:54:30Z</dc:date>
    <item>
      <title>How to Crate Mtext and visible with the cursor, &amp; exit when escape</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-crate-mtext-and-visible-with-the-cursor-amp-exit-when/m-p/7681609#M28145</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am trying to create a tool by which can provide Mtext by clicking a button.&lt;/P&gt;&lt;P&gt;1. Mtext contain will visible [jig] with the cursor.&lt;/P&gt;&lt;P&gt;2. after locating a point its can not exit from the command will asking for another point with compiled mtext contain [contain changed] - loop.&lt;/P&gt;&lt;P&gt;3. when press the escape button it will exit from the operation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;created Mtext and can provide in the AutoCAD interface. whereas the operation exit after one operation. &lt;STRONG&gt;jig&lt;/STRONG&gt; creation is new for me&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help!&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jan 2018 09:46:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-crate-mtext-and-visible-with-the-cursor-amp-exit-when/m-p/7681609#M28145</guid>
      <dc:creator>kite15</dc:creator>
      <dc:date>2018-01-11T09:46:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to Crate Mtext and visible with the cursor, &amp; exit when escape</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-crate-mtext-and-visible-with-the-cursor-amp-exit-when/m-p/7681720#M28146</link>
      <description>&lt;P&gt;You should post the code you have tried, and then it may be easier to understand what you're trying to do.&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/3144830"&gt;@kite15&lt;/a&gt; wrote:&lt;BR /&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am trying to create a tool by which can provide Mtext by clicking a button.&lt;/P&gt;&lt;P&gt;1. Mtext contain will visible [jig] with the cursor.&lt;/P&gt;&lt;P&gt;2. after locating a point its can not exit from the command will asking for another point with compiled mtext contain [contain changed] - loop.&lt;/P&gt;&lt;P&gt;3. when press the escape button it will exit from the operation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;created Mtext and can provide in the AutoCAD interface. whereas the operation exit after one operation. &lt;STRONG&gt;jig&lt;/STRONG&gt; creation is new for me&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help!&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jan 2018 10:34:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-crate-mtext-and-visible-with-the-cursor-amp-exit-when/m-p/7681720#M28146</guid>
      <dc:creator>ActivistInvestor</dc:creator>
      <dc:date>2018-01-11T10:34:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to Crate Mtext and visible with the cursor, &amp; exit when escape</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-crate-mtext-and-visible-with-the-cursor-amp-exit-when/m-p/7681763#M28147</link>
      <description>&lt;P&gt;Please see the snap for the code [Mtexts]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jan 2018 10:54:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-crate-mtext-and-visible-with-the-cursor-amp-exit-when/m-p/7681763#M28147</guid>
      <dc:creator>kite15</dc:creator>
      <dc:date>2018-01-11T10:54:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to Crate Mtext and visible with the cursor, &amp; exit when escape</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-crate-mtext-and-visible-with-the-cursor-amp-exit-when/m-p/7682076#M28148</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's a simple example using a command you can adapt to your dialog.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;    public class Commands
    {
        [CommandMethod("MIMT")]
        public void MultiInsertMText()
        {
            var doc = AcAp.DocumentManager.MdiActiveDocument;
            var db = doc.Database;
            var ed = doc.Editor;
            using (var tr = db.TransactionManager.StartTransaction())
            {
                var curSpace = (BlockTableRecord)tr.GetObject(db.CurrentSpaceId, OpenMode.ForWrite);
                while (true)
                {
                    using (var mtext = new MText())
                    {
                        mtext.Contents = "Drag me !";
                        mtext.Height = db.Textsize;
                        mtext.Rotation = Math.PI / 2.0;
                        mtext.Attachment = AttachmentPoint.MiddleCenter;
                        mtext.TextStyleId = db.Textstyle;
                        curSpace.AppendEntity(mtext);
                        tr.AddNewlyCreatedDBObject(mtext, true);
                        MTextJig jig = new MTextJig(mtext);
                        var result = ed.Drag(jig);
                        if (result.Status != PromptStatus.OK)
                        {
                            mtext.Erase();
                            break;
                        }
                        db.TransactionManager.QueueForGraphicsFlush();

                    }
                }
                tr.Commit();
            }
        }
    }

    class MTextJig : EntityJig
    {
        MText mtext;
        Point3d basePt, dragPt;

        public MTextJig(MText mtext) : base(mtext)
        {
            this.mtext = mtext;
            basePt = mtext.Location;
        }

        protected override SamplerStatus Sampler(JigPrompts prompts)
        {
            var options = new JigPromptPointOptions("\nInsertion point: ");
            options.BasePoint = basePt;
            options.UseBasePoint = true;
            options.UserInputControls =
                UserInputControls.Accept3dCoordinates |
                UserInputControls.NullResponseAccepted | // allows Enter to break the loop
                UserInputControls.UseBasePointElevation;
            var result = prompts.AcquirePoint(options);
            if (result.Value.IsEqualTo(dragPt))
                return SamplerStatus.NoChange;
            dragPt = result.Value;
            return SamplerStatus.OK;
        }

        protected override bool Update()
        {
            mtext.Location = dragPt;
            return true;
        }
    }&lt;/PRE&gt;</description>
      <pubDate>Thu, 11 Jan 2018 12:54:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-crate-mtext-and-visible-with-the-cursor-amp-exit-when/m-p/7682076#M28148</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2018-01-11T12:54:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to Crate Mtext and visible with the cursor, &amp; exit when escape</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-crate-mtext-and-visible-with-the-cursor-amp-exit-when/m-p/7682178#M28149</link>
      <description>&lt;P&gt;Hi _gile,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This is perfect another&amp;nbsp;one,&amp;nbsp;thank you for your continuous help awesome&amp;nbsp;&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;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jan 2018 13:33:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-crate-mtext-and-visible-with-the-cursor-amp-exit-when/m-p/7682178#M28149</guid>
      <dc:creator>kite15</dc:creator>
      <dc:date>2018-01-11T13:33:18Z</dc:date>
    </item>
  </channel>
</rss>

