<?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 Text Justify and Position in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/text-justify-and-position/m-p/2415252#M72114</link>
    <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
I am setting text fine until I try to set the Justify property. Then it places the text at 0,0.&lt;BR /&gt;
&lt;BR /&gt;
Can anyone point me where I am going wrong?&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
using (Transaction tr = doc.Database.TransactionManager.StartTransaction())&lt;BR /&gt;
{&lt;BR /&gt;
	Point3d loc = new Point3d();&lt;BR /&gt;
	foreach (ObjectId Id in res.Value.GetObjectIds())&lt;BR /&gt;
	{&lt;BR /&gt;
		MText mtxt = (MText)tr.GetObject(Id, OpenMode.ForRead);&lt;BR /&gt;
		loc = mtxt.Location;&lt;BR /&gt;
		string strAllLines = mtxt.Text;&lt;BR /&gt;
		StringReader reader = new StringReader(strAllLines);&lt;BR /&gt;
		string strRooomId = reader.ReadLine();&lt;BR /&gt;
&lt;BR /&gt;
		DBText txt = new DBText();&lt;BR /&gt;
		txt.Justify = AttachmentPoint.MiddleCenter;&lt;BR /&gt;
		txt.Height = mtxt.TextHeight;&lt;BR /&gt;
		txt.TextString = strRooomId;&lt;BR /&gt;
		txt.Position = loc;&lt;BR /&gt;
		&lt;BR /&gt;
&lt;BR /&gt;
		BlockTableRecord btr = (BlockTableRecord)tr.GetObject(doc.Database.CurrentSpaceId, OpenMode.ForWrite);&lt;BR /&gt;
		btr.AppendEntity(txt);&lt;BR /&gt;
		tr.AddNewlyCreatedDBObject(txt, true);&lt;BR /&gt;
	}&lt;BR /&gt;
	tr.Commit();</description>
    <pubDate>Tue, 20 Jan 2009 23:57:54 GMT</pubDate>
    <dc:creator>odoshi</dc:creator>
    <dc:date>2009-01-20T23:57:54Z</dc:date>
    <item>
      <title>Text Justify and Position</title>
      <link>https://forums.autodesk.com/t5/net-forum/text-justify-and-position/m-p/2415252#M72114</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
I am setting text fine until I try to set the Justify property. Then it places the text at 0,0.&lt;BR /&gt;
&lt;BR /&gt;
Can anyone point me where I am going wrong?&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
using (Transaction tr = doc.Database.TransactionManager.StartTransaction())&lt;BR /&gt;
{&lt;BR /&gt;
	Point3d loc = new Point3d();&lt;BR /&gt;
	foreach (ObjectId Id in res.Value.GetObjectIds())&lt;BR /&gt;
	{&lt;BR /&gt;
		MText mtxt = (MText)tr.GetObject(Id, OpenMode.ForRead);&lt;BR /&gt;
		loc = mtxt.Location;&lt;BR /&gt;
		string strAllLines = mtxt.Text;&lt;BR /&gt;
		StringReader reader = new StringReader(strAllLines);&lt;BR /&gt;
		string strRooomId = reader.ReadLine();&lt;BR /&gt;
&lt;BR /&gt;
		DBText txt = new DBText();&lt;BR /&gt;
		txt.Justify = AttachmentPoint.MiddleCenter;&lt;BR /&gt;
		txt.Height = mtxt.TextHeight;&lt;BR /&gt;
		txt.TextString = strRooomId;&lt;BR /&gt;
		txt.Position = loc;&lt;BR /&gt;
		&lt;BR /&gt;
&lt;BR /&gt;
		BlockTableRecord btr = (BlockTableRecord)tr.GetObject(doc.Database.CurrentSpaceId, OpenMode.ForWrite);&lt;BR /&gt;
		btr.AppendEntity(txt);&lt;BR /&gt;
		tr.AddNewlyCreatedDBObject(txt, true);&lt;BR /&gt;
	}&lt;BR /&gt;
	tr.Commit();</description>
      <pubDate>Tue, 20 Jan 2009 23:57:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/text-justify-and-position/m-p/2415252#M72114</guid>
      <dc:creator>odoshi</dc:creator>
      <dc:date>2009-01-20T23:57:54Z</dc:date>
    </item>
    <item>
      <title>Re: Text Justify and Position</title>
      <link>https://forums.autodesk.com/t5/net-forum/text-justify-and-position/m-p/2415253#M72115</link>
      <description>Try the AlignmentPoint property instead of the Position property.</description>
      <pubDate>Wed, 21 Jan 2009 05:08:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/text-justify-and-position/m-p/2415253#M72115</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-01-21T05:08:22Z</dc:date>
    </item>
    <item>
      <title>Re: Text Justify and Position</title>
      <link>https://forums.autodesk.com/t5/net-forum/text-justify-and-position/m-p/2415254#M72116</link>
      <description>Yep - that did it. Thanks!</description>
      <pubDate>Thu, 22 Jan 2009 22:23:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/text-justify-and-position/m-p/2415254#M72116</guid>
      <dc:creator>odoshi</dc:creator>
      <dc:date>2009-01-22T22:23:58Z</dc:date>
    </item>
  </channel>
</rss>

