C#)DBText alignment error when openning ReadDwgFile Method have modified DBText

C#)DBText alignment error when openning ReadDwgFile Method have modified DBText

Anonymous
Not applicable
830 Views
2 Replies
Message 1 of 3

C#)DBText alignment error when openning ReadDwgFile Method have modified DBText

Anonymous
Not applicable

Hi.

 

Please attachment video.

 

DBtext alignment  is not right when DBText update by ReadDwgFile Method.

 

Open the drawing can be seen that the change position when DBText TextEdit mode.

 

ex) DBText Change Method

public void ChangeDBTExt
{
          Database acCurDB = new Database(false, false);
          acCurDB.ReadDwgFile(filePath, FileOpenMode.OpenForReadAndAllShare, false, "");
          acCurDB.CloseInput(true);

          using (Transaction acTrans = acdoc.TransactionManager.StartTransaction())
          {
               DBText dbtext = acTrans.GetObject(MyFocusedHandle, OpenMode.ForRead) as DBText;
               dbText.UpgradeOpen();
               dbText.TextString = MyString;
               //dbText.AdjustAlignment(acCurDB);
                    
               acTrans.Commit();
           }             
}

 

 

So I searched a site to calculate mid alignment (http://www.acadnetwork.com/index.php?topic=311.0)

 

but this method also fails.

 

Will you have any way to solve this problem?

 

Thanks.

0 Likes
831 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable

I solved that.

 

Thanks.

 

 

0 Likes
Message 3 of 3

Anonymous
Not applicable

Hodw do you solve that? I met this problem. I find that the position property not updated correcty after I change the  textstring.

0 Likes