How can I change/save values of entities within an image
Moderators: SDS, support, admin
-
- Posts: 2
- Joined: 18 Aug 2021, 17:56
How can I change/save values of entities within an image
I have the current code and I want to change the value of text fields from what they are to something different and save the file as a new temp file.
Code: Select all
CADImage cadImage = CADImage.CreateImageByExtension(@"file path to file");
cadImage.LoadFromFile(@"file path to file");
CADEntityCollection entities = cadImage.Converter.Entities;
foreach (CADEntity entity in entities)
{
if (entity.EntType.ToString() == "Text")
{
// change current text value of entity to a new text value
}
}
//save to new temp .dwg file
Re: How can I change/save values of entities within an image
Hello,
To change the value of TEXT entity, please use the following code:
As for saving to a DWG file, you will find instructions in the given topic: viewtopic.php?f=15&t=10198
Mikhail
To change the value of TEXT entity, please use the following code:
Code: Select all
if (entity.EntType == EntityType.Text)
{
CADText text = entity as CADText;
text.Text = "NewValue";
cadImage.Converter.Loads(text);
}
Mikhail
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support