UNDO command working odd after loading opendcl

Started by Edward, July 06, 2016, 09:57:49 AM

Previous topic - Next topic

Edward

Hi,

When I load opendcl form within my app, my U (undo) command has changed.
I can not undo anything created after loading the form.
But when I UNDO with the value of 2 (instead of the default value of 1), each change I've made can be undo(ne). Also drawing 3 entities and to undo those I need a value of 4.
Someway the UNDO command does need an extra (1) value to undo things.

I can not reset this to the value of one. As it won't undo anything with that value.
Only a restart of AutoCAD (Civil 3D) or re-opening the drawing will fix it.
Btw. I am doing nothing with the UNDO command in my app.

Any help is welcome.

Thanks.

owenwengerd

Please copy and paste the command line output so it's more clear what you mean, and what actually is being undone at each step.
Owen Wengerd (Outside The Box) / ManuSoft

Edward

Hi Owen,

Here's the output.
Some explanation: I draw a Circle and a Line.
Then I use the U command twice.
The U command then undo the Line and Circle.

I draw a Circle and a Line again.
Then I load the OpenDCL form.
Then I use the U command, but without success undoing the Line or Circle.
The I use the UNDO command with the value of 2...

-------------------------<BEGIN>
Command: C
CIRCLE
Specify center point for circle or [3P/2P/Ttr (tan tan radius)]:
Specify radius of circle or [Diameter]:
Command: L
LINE
Specify first point:
Specify next point or [Undo]:
Specify next point or [Undo]:

Command: U
LINE
Command:
Command: U
CIRCLE
Command:
Command: C
CIRCLE
Specify center point for circle or [3P/2P/Ttr (tan tan radius)]:
Specify radius of circle or [Diameter]:
Command: L
LINE
Specify first point:
Specify next point or [Undo]:
Specify next point or [Undo]:

Command:
Command: _GEOFINDER
Initializing...
OpenDCL Runtime [8.0.0.13] loaded

Command:
U

Command:
Command:
U

Command:
Command:
UNDO
Current settings: Auto = On, Control = All, Combine = Yes, Layer = Yes
Enter the number of operations to undo or [Auto/Control/BEgin/End/Mark/Back] <1>: 2
LINE
Command:
Command:
UNDO
Current settings: Auto = On, Control = All, Combine = Yes, Layer = Yes
Enter the number of operations to undo or [Auto/Control/BEgin/End/Mark/Back] <1>: 2
CIRCLE
Command:

-------------------------<END>

As you may see, that when the OpenDCL form is loaded, I can not use the U command any more.
Or actually the U command is doing nothing.
But when I use the UNDO command and use the value of 2, it does undo the Line I have drawn.

Thanks.

owenwengerd

What you observe indicates that the form events are creating undo records. When you enter U immediately afterward, it _is_ undoing something, but it's a modeless operation with no name. It's possible that while your form is displayed, the U command itself (or the form losing focus) triggers a new event to be fired, which adds a new undo record, and so you can never make any progress because a new record is added every time you undo 1 step.

I don't know what your form does, but you can find an offending event and investigate it more closely. I would disable all events, then re-enable them one a time until the problem returns. Then you can focus on a single event to figure out why it creates an undo record. Perhaps the problem can be avoided entirely by changing your Event Invoke property. Alternatively, perhaps you can use undo begin/end brackets around your form activity to make it all a single undo record.

Hopefully that helps.
Owen Wengerd (Outside The Box) / ManuSoft