Changes to the entities
Moderators: SDS, support, admin
Changes to the entities
Hello,
I need to track changes to the entities: programming and via mouse/keyboard. As I understood from one of the posts I have to use CADEntity.OnDraw() event. But I could not find how to do it anywhere. Any chance you could provide an example how to do it? Basically I am trying to implement custom Undo/redo function which will track programmatic changes to the entities vs only visual changes.
Thanks in advance!
I need to track changes to the entities: programming and via mouse/keyboard. As I understood from one of the posts I have to use CADEntity.OnDraw() event. But I could not find how to do it anywhere. Any chance you could provide an example how to do it? Basically I am trying to implement custom Undo/redo function which will track programmatic changes to the entities vs only visual changes.
Thanks in advance!
Re: Changes to the entities
Hello,
CADEntity.DrawEvent occurs when you move or resize the entity with a mouse, i.e. visual editing takes place. To track the programmatic changes, you can use the following code:
The LoadEntity() method should be called right after you change a value of entity's property from code.
Mikhail
CADEntity.DrawEvent occurs when you move or resize the entity with a mouse, i.e. visual editing takes place. To track the programmatic changes, you can use the following code:
Code: Select all
private CADEntityCollection changedEntities = new CADEntityCollection();
...
private void LoadEntity(CADImage cadImage, CADEntity ent)
{
try
{
cadImage.Converter.Loads(ent);
}
finally
{
// Entity was changed programmatically
changedEntities.Add(ent);
}
}
Mikhail
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support