<?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: Mtext Attribute Location / Alignmentpoint / Position in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/mtext-attribute-location-alignmentpoint-position/m-p/10662607#M15023</link>
    <description>&lt;P&gt;You have to first check if the attribute reference is a MTextAttribute and make things differently if it is or if it is not.&lt;/P&gt;
&lt;P&gt;Something like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="csharp"&gt;if(att.IsMTextAttribute)
{
    attNew.IsMTextAttribute = true;
    MText mtext = att.MTextAttribute;
    MText mtextNew = attNew.MTextAttribute;
    mtextNew.Location = mtext.Location;
    mtextNew.Attachment = mtext.Attachment;
    mtextNew.Contents = mtext.Contents;
    attNew.MTextAttribute = mtextNew;
}
else
{
    attNew.Position = att.Position;
    attNew.TextString = att.TextString;
    if (att.Justify == AttachmentPoint.BaseLeft)
    {
        attNew.Justify = AttachmentPoint.BaseLeft;
    }
    else
    {
        attNew.Justify = att.Justify;
        attNew.AlignmentPoint = att.AlignmentPoint;
    }
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 02 Oct 2021 21:00:50 GMT</pubDate>
    <dc:creator>_gile</dc:creator>
    <dc:date>2021-10-02T21:00:50Z</dc:date>
    <item>
      <title>Mtext Attribute Location / Alignmentpoint / Position</title>
      <link>https://forums.autodesk.com/t5/net-forum/mtext-attribute-location-alignmentpoint-position/m-p/10660217#M15020</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to swap one block for another and I have a multiline attribute, so I am trying to mimic the justification and alignment to be as per the original. I know that as a single line attribute, if the justification is Bottom left, I use position and if otherwise I use the alignment point. This works perfect!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Why does this not work with the Multiline Attribute but only when the justification is Left?&lt;/P&gt;&lt;P&gt;The IsMTextAttribute object gives me a new position that is Location, but this doesn't work either. I have tried the alignment point, the position even the attachment point, but for the life of me I cannot get the Right justified MtextAttributes to match that of the original block.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is no subject matter on this that I can find anywhere. Does anyone have a hint that might get me where I need to be to move this attribute?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Oct 2021 10:14:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/mtext-attribute-location-alignmentpoint-position/m-p/10660217#M15020</guid>
      <dc:creator>js75CAD</dc:creator>
      <dc:date>2021-10-01T10:14:25Z</dc:date>
    </item>
    <item>
      <title>Re: Mtext Attribute Location / Alignmentpoint / Position</title>
      <link>https://forums.autodesk.com/t5/net-forum/mtext-attribute-location-alignmentpoint-position/m-p/10660346#M15021</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Have a look at &lt;A href="https://help.autodesk.com/view/OARX/2019/ENU/?guid=OREFNET-__MEMBERTYPE_Properties_Autodesk_AutoCAD_DatabaseServices_MText" target="_blank" rel="noopener"&gt;MText properties&lt;/A&gt; in the documentation specifically &lt;A href="https://help.autodesk.com/view/OARX/2019/ENU/?guid=OREFNET-Autodesk_AutoCAD_DatabaseServices_MText_Location" target="_blank" rel="noopener"&gt;Location&lt;/A&gt; and &lt;A href="https://help.autodesk.com/view/OARX/2019/ENU/?guid=OREFNET-Autodesk_AutoCAD_DatabaseServices_MText_Attachment" target="_blank" rel="noopener"&gt;Attachment&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;After having edited the MText, to update the attribute, you have to reset the modified MText as MTextAttribute:&lt;/P&gt;
&lt;LI-CODE lang="csharp"&gt;attributeReference.MtextAttribute = mtext;&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 01 Oct 2021 11:31:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/mtext-attribute-location-alignmentpoint-position/m-p/10660346#M15021</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2021-10-01T11:31:14Z</dc:date>
    </item>
    <item>
      <title>Re: Mtext Attribute Location / Alignmentpoint / Position</title>
      <link>https://forums.autodesk.com/t5/net-forum/mtext-attribute-location-alignmentpoint-position/m-p/10661603#M15022</link>
      <description>&lt;P&gt;_gile,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks, but this doesn't work either. I am not sure why Autodesk go out of their way to make things so bloody difficult! How many points do you need? Location, attachmentpoint, alignmentPoint, Position... come on!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;attNew.TextString = att.MTextAttribute.Contents

Select Case att.Justify.ToString
Case "MiddleRight"
attNew.MTextAttribute.Attachment = att.MTextAttribute.Attachment
attNew.AlignmentPoint = att.AlignmentPoint

Case Else
attNew.Justify = att.Justify
attNew.AlignmentPoint = att.AlignmentPoint
End Select

attNew.UpdateMTextAttribute()&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is what I have so far. If the MTextAttribute is Left justified, no problem. But the minute it becomes right justified, it keeps throwing the text. Now I have managed to make it just move slightly, but the grip point is moving and I am not sure what that point is? Below you can see what I am trying to achieve.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="js75CAD_0-1633127735380.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/972501i2709E98FA41BEBC2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="js75CAD_0-1633127735380.png" alt="js75CAD_0-1633127735380.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Oct 2021 22:35:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/mtext-attribute-location-alignmentpoint-position/m-p/10661603#M15022</guid>
      <dc:creator>js75CAD</dc:creator>
      <dc:date>2021-10-01T22:35:53Z</dc:date>
    </item>
    <item>
      <title>Re: Mtext Attribute Location / Alignmentpoint / Position</title>
      <link>https://forums.autodesk.com/t5/net-forum/mtext-attribute-location-alignmentpoint-position/m-p/10662607#M15023</link>
      <description>&lt;P&gt;You have to first check if the attribute reference is a MTextAttribute and make things differently if it is or if it is not.&lt;/P&gt;
&lt;P&gt;Something like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="csharp"&gt;if(att.IsMTextAttribute)
{
    attNew.IsMTextAttribute = true;
    MText mtext = att.MTextAttribute;
    MText mtextNew = attNew.MTextAttribute;
    mtextNew.Location = mtext.Location;
    mtextNew.Attachment = mtext.Attachment;
    mtextNew.Contents = mtext.Contents;
    attNew.MTextAttribute = mtextNew;
}
else
{
    attNew.Position = att.Position;
    attNew.TextString = att.TextString;
    if (att.Justify == AttachmentPoint.BaseLeft)
    {
        attNew.Justify = AttachmentPoint.BaseLeft;
    }
    else
    {
        attNew.Justify = att.Justify;
        attNew.AlignmentPoint = att.AlignmentPoint;
    }
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 02 Oct 2021 21:00:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/mtext-attribute-location-alignmentpoint-position/m-p/10662607#M15023</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2021-10-02T21:00:50Z</dc:date>
    </item>
    <item>
      <title>Re: Mtext Attribute Location / Alignmentpoint / Position</title>
      <link>https://forums.autodesk.com/t5/net-forum/mtext-attribute-location-alignmentpoint-position/m-p/10662723#M15024</link>
      <description>Thank you _gile!&lt;BR /&gt;&lt;BR /&gt;I had already checked if it was (sorry i should have included that part of the code), but I misunderstood what you meant by the Mtext. I now know what I did wrong.&lt;BR /&gt;&lt;BR /&gt;Admittedly, I still am struggling to understand the difference between all the points, but now I have this, I will start testing different scenarios to see how they change. I just wish they has some documentation on this.&lt;BR /&gt;&lt;BR /&gt;Much appreciated and whereever you are in the world, have an awesome weekend!</description>
      <pubDate>Sat, 02 Oct 2021 23:07:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/mtext-attribute-location-alignmentpoint-position/m-p/10662723#M15024</guid>
      <dc:creator>js75CAD</dc:creator>
      <dc:date>2021-10-02T23:07:43Z</dc:date>
    </item>
  </channel>
</rss>

