<?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 Get|Set Alignment of DBText in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/get-set-alignment-of-dbtext/m-p/1836696#M79661</link>
    <description>I'm receiving a DBText object from the User.  I want to create a given number of DBText objects changing the text string based on entered information.  I want all of the newly created DBText objects to have the Same Justification.  I know the DBText object Has (Boolean IsDefaultAlignment) and (Point3d AlignmentPoint), but there doesn't seem to be a way to get what the Alignment is of the Selected obj. &lt;BR /&gt;
&lt;BR /&gt;
Any help is greatly appreciated,&lt;BR /&gt;
Adam</description>
    <pubDate>Thu, 07 Dec 2006 20:53:56 GMT</pubDate>
    <dc:creator>acedmond</dc:creator>
    <dc:date>2006-12-07T20:53:56Z</dc:date>
    <item>
      <title>Get|Set Alignment of DBText</title>
      <link>https://forums.autodesk.com/t5/net-forum/get-set-alignment-of-dbtext/m-p/1836696#M79661</link>
      <description>I'm receiving a DBText object from the User.  I want to create a given number of DBText objects changing the text string based on entered information.  I want all of the newly created DBText objects to have the Same Justification.  I know the DBText object Has (Boolean IsDefaultAlignment) and (Point3d AlignmentPoint), but there doesn't seem to be a way to get what the Alignment is of the Selected obj. &lt;BR /&gt;
&lt;BR /&gt;
Any help is greatly appreciated,&lt;BR /&gt;
Adam</description>
      <pubDate>Thu, 07 Dec 2006 20:53:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/get-set-alignment-of-dbtext/m-p/1836696#M79661</guid>
      <dc:creator>acedmond</dc:creator>
      <dc:date>2006-12-07T20:53:56Z</dc:date>
    </item>
    <item>
      <title>Re: Get|Set Alignment of DBText</title>
      <link>https://forums.autodesk.com/t5/net-forum/get-set-alignment-of-dbtext/m-p/1836697#M79662</link>
      <description>&amp;gt;to be a way to get what the Alignment is of the Selected obj.&lt;BR /&gt;
&lt;BR /&gt;
Use something like this:&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
        [CommandMethod("DBTEXT")]&lt;BR /&gt;
        public void dbtext()&lt;BR /&gt;
        {&lt;BR /&gt;
            Document doc = acadApp.DocumentManager.MdiActiveDocument;&lt;BR /&gt;
            Editor ed = doc.Editor;&lt;BR /&gt;
            Database db = doc.Database;&lt;BR /&gt;
            PromptEntityResult res = ed.GetEntity("\nSelect text: ");&lt;BR /&gt;
            if (res.Status != PromptStatus.OK) return;&lt;BR /&gt;
            using (Transaction tr = &lt;BR /&gt;
db.TransactionManager.StartTransaction())&lt;BR /&gt;
            {&lt;BR /&gt;
                DBText text = tr.GetObject(res.ObjectId, OpenMode.ForRead, &lt;BR /&gt;
false) as DBText;&lt;BR /&gt;
                ed.WriteMessage("\nAlignment is " + &lt;BR /&gt;
text.HorizontalMode.ToString());&lt;BR /&gt;
                tr.Commit();&lt;BR /&gt;
            }&lt;BR /&gt;
&lt;BR /&gt;
        }</description>
      <pubDate>Thu, 07 Dec 2006 21:39:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/get-set-alignment-of-dbtext/m-p/1836697#M79662</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-12-07T21:39:47Z</dc:date>
    </item>
    <item>
      <title>Re: Get|Set Alignment of DBText</title>
      <link>https://forums.autodesk.com/t5/net-forum/get-set-alignment-of-dbtext/m-p/1836698#M79663</link>
      <description>I wrote, the previous code to fast.... and forgot something - to check if we &lt;BR /&gt;
select a text....:&lt;BR /&gt;
&lt;BR /&gt;
        [CommandMethod("DBTEXT")]&lt;BR /&gt;
        public void dbtext()&lt;BR /&gt;
        {&lt;BR /&gt;
            Document doc = acadApp.DocumentManager.MdiActiveDocument;&lt;BR /&gt;
            Editor ed = doc.Editor;&lt;BR /&gt;
            Database db = doc.Database;&lt;BR /&gt;
            //PromptEntityOptions prOpt = new PromptEntityOptions("\nSelect &lt;BR /&gt;
text: ");&lt;BR /&gt;
            //prOpt.SetRejectMessage("\nText object only!");&lt;BR /&gt;
            //prOpt.AddAllowedClass(typeof(DBText), true);&lt;BR /&gt;
            //PromptEntityResult rs = ed.GetEntity(prOpt);&lt;BR /&gt;
            PromptEntityResult res = ed.GetEntity("\nSelect text: ");&lt;BR /&gt;
            if (res.Status != PromptStatus.OK) return;&lt;BR /&gt;
            using (Transaction tr = &lt;BR /&gt;
db.TransactionManager.StartTransaction())&lt;BR /&gt;
            {&lt;BR /&gt;
                DBText text = tr.GetObject(res.ObjectId, OpenMode.ForRead, &lt;BR /&gt;
false) as DBText;&lt;BR /&gt;
                if (text != null)&lt;BR /&gt;
                {&lt;BR /&gt;
                    ed.WriteMessage("\nAlignment is " + &lt;BR /&gt;
text.HorizontalMode.ToString());&lt;BR /&gt;
                }&lt;BR /&gt;
                tr.Commit();&lt;BR /&gt;
            }&lt;BR /&gt;
&lt;BR /&gt;
        }</description>
      <pubDate>Thu, 07 Dec 2006 23:22:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/get-set-alignment-of-dbtext/m-p/1836698#M79663</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-12-07T23:22:56Z</dc:date>
    </item>
  </channel>
</rss>

