c# mtext block formatting issue

c# mtext block formatting issue

smullinaxKVYYA
Contributor Contributor
806 Views
1 Reply
Message 1 of 2

c# mtext block formatting issue

smullinaxKVYYA
Contributor
Contributor

I am grabbing one mtext block from a .dwg and after replacing a bit of the mtext by setting the mtext.content equal to a string I then copy it with WblockCloneObjects() to a new .dwg. 

 

I am having one issue where I have \t for tabs in the mtext replacement, but the new copy is adding a extra tab than what is in the mtext.contents. 

 

I am having another issue where the colors of the mtext are replaced with whatever the block layer color is for the mtext. So if I have in one mtext a string partly red and partly blue, the new copy will only reflect the block layer's set color.

 

Thank you for any help and let me know if any more information is needed.

0 Likes
807 Views
1 Reply
Reply (1)
Message 2 of 2

smullinaxKVYYA
Contributor
Contributor

Here are some pictures of my issue to hopefully give more detail. Also I am using version R.47.0.0 Autocad 2021

The first is the messed up result after the mtext's content is replaced with a string = "Front\t\t\t\t20'\nSide\t\t\t\t5'\nRear\t\t\t\t18'\nCorner\t\t\t\t15'\n"   .

 

The second is what my expected result from the string should be.

 

The third is a picture of me copying the resulting mtext from the .dwg file and entering the text with formatting into notepad++ and showing the text codes as well as the text. As you can see from this file and the string there are equal tabs in each new line, but the first picture shows an extra tab on the last line.

0 Likes