Set Text in a CADText
Moderators: SDS, support, admin
Set Text in a CADText
Hello,
I have a problem with CADText in a dwg file.
I load the file and then I try to change the text by code, by setting CADText.Text property, but text doesn't change!
Can someone help me?
Thanks!
I have a problem with CADText in a dwg file.
I load the file and then I try to change the text by code, by setting CADText.Text property, but text doesn't change!
Can someone help me?
Thanks!
Re: Set Text in a CADText
Hello,
The code below assigns a new value to CADText:
Mikhail.
The code below assigns a new value to CADText:
Code: Select all
CADImage cadImage;
...
private void ChangeText(string textValue, string newValue)
{
foreach (CADEntity entity in cadImage.Converter.Entities)
{
if (entity.EntType == EntityType.Text)
{
CADText cadText = entity as CADText;
if (cadText.Text == textValue)
{
cadText.Text = newValue;
cadImage.Converter.Loads(cadText);
cadImage.GetExtents();
}
}
}
}
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support
Re: Set Text in a CADText
Hello Mikhail,
It's possible to insert a multiline text in a CADText?
Thank you in advance.
It's possible to insert a multiline text in a CADText?
Thank you in advance.
Re: Set Text in a CADText
Hello.
CAD Import .NET provides CADMText class as multiline texts representation. Any multiline text on a drawing will be imported as CADMText object. If you need to replace single line text with multiline text then delete CADText object and create new MText instead of it.
Alexander.
CAD Import .NET provides CADMText class as multiline texts representation. Any multiline text on a drawing will be imported as CADMText object. If you need to replace single line text with multiline text then delete CADText object and create new MText instead of it.
Alexander.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support