Tuesday, November 28, 2023
Home3D ModelingForestall customers to get again erased entity - Ruby API

Forestall customers to get again erased entity – Ruby API


I at present writing a software which have to make use of intersect_with methodology then after that delete the road which created. However after i’’ve delete the intersection line I discovered that once I press ctr + z, traces that already delete space coming again. I don’t need customers to see intersection traces within the course of. Is there a technique to stop traces coming again?


Maybe an professional will appropriate me, however I feel the reply is not any.

Each operation is added to the undo stack, each for the GUI and for Ruby. Ctrl-z undoes the final operation on the stack. I don’t suppose there’s a technique to block undo and the Ruby API doesn’t present entry to the stack.



1 Like

I assume you’re doing different operations beside #intersect_with. You’ll be able to wrap all this strategies into one operation which seen in unto stack, so the consumer is not going to see “Undo erase” or different operation individually, however .

In some circumstances after you collected the required information concerning the geometries created then you should use #abort_operation to make the earlier operation “un-happened” …

Examine this strategies:

The #start_operation methodology is used to inform SketchUp {that a} new operation (which will be undone) is beginning. ( have a look particularly the final parameter )

The #commit_operation methodology commits an operation for undo.

The #abort_operation methodology aborts the present operation began with the start_operation methodology.



1 Like

I agree with @dezmo, a software ought to at all times wrap all it’s subtasks in a single undo operation.



1 Like

You’ll be able to add an undo observer to your mannequin if you wish to take some motion after an undo. For instance: one thing like updating an inspector present the variety of edges within the mannequin.

Be very cautious although to not do something that might have an effect on the undo stack. I had some code in an undo observer as soon as which up to date an inspector. It contained a bug the place inadvertently modifications have been made to the mannequin. That resulted in a really irritating consumer expertise.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments