I'm 9 hours ahead of. Was watching C64 repairs on Youtube while eating dinner.
I haven't had much time lately. The GitHub repo is rather old, but contains LockViews. I've started updating the macro help file and fixed a few bugs. I may be able to push a newer public zip version on the weekend.
Original Message:
Sent: 03-04-2026 03:21
From: Fernando Calvo
Subject: how to catch a general Undo/Redo/delete event?
and thanks for the info about LockViews, it looks great and something similar to what I´ve been building for Buildings. I didn´t know that macro from you and also checked all others that I had from you, so having a look now at your github stuff to download that one too ;-)
Thanks again !
------------------------------
Fernando Calvo
calvo@calvo-geospatial.com
Original Message:
Sent: 03-04-2026 03:18
From: Fernando Calvo
Subject: how to catch a general Undo/Redo/delete event?
Hi Ronny,
wow, this was quick and helpfful ! thanks so much !
I have looked for something similar on the Object Catalogue for a while and tried different things but without success, and therefore I finally asked here.
Thanks again Ronny !
Regards,
Fernando
------------------------------
Fernando Calvo
calvo@calvo-geospatial.com
Original Message:
Sent: 03-04-2026 03:03
From: Ronny Schneider
Subject: how to catch a general Undo/Redo/delete event?
Hello Fernando,
that is relative simple, it's the event "WindowViewChanged"
i.e.
activeForm = TrimbleOffice.TheOffice.MainWindow.AppViewManager.ActiveViewactiveForm.WindowViewChanged += self.hoopsviewevent
As i.e. used/demonstrated in my LockViews macro.
You just may have to turn the trigger off/on before/after changing the view with a macro, otherwise you may trigger-trigger-trigger-trigger................................................. yourself all the time.
------------------------------
Ronny Schneider
Original Message:
Sent: 03-04-2026 02:30
From: Fernando Calvo
Subject: how to catch a general Undo/Redo/delete event?
Hi Bryce,
is there any Event to check if the current view has been changed i.e. through zoom or pan or similar?
Thanks.
Regards,
Fernando
------------------------------
Fernando Calvo
calvo@calvo-geospatial.com
Original Message:
Sent: 06-20-2024 12:27
From: Bryce Haire
Subject: how to catch a general Undo/Redo/delete event?
Hey Ronny,
Unfortunately, there is no general panacea of all the events you are looking for.
There's a couple more that you may want to look at in UIEvents (Trimble.Vce.UI.UIManager).
BeforeDataProcessing/AfterDataProcessing event handlers are heavily used by TBC commands for handling the cases you are describing. These get fired before/after the processing is complete. See if this leads you anywhere.
------------------------------
Bryce Haire
Original Message:
Sent: 06-20-2024 02:07
From: Ronny Schneider
Subject: how to catch a general Undo/Redo/delete event?
Thanks Bryce.
I had seen that UndoWatcher, but didn't really look into it since it's only sending some strings and I'd have to monitor their change "manually".
It also doesn't cover if the user deleted/added entities with another function/macro, which would require my macro to reload some data.
I'm really surprised that the project doesn't fire those events automatically.
Not super critical right now. If I have more time I'll have another look.
------------------------------
Ronny Schneider
Original Message:
Sent: 06-19-2024 11:36
From: Bryce Haire
Subject: how to catch a general Undo/Redo/delete event?
Hi Ronny,
I would suggest looking at the IUndoWatcher service.
It should be (currently) located in Trimble.Sdk.UI namespace.
My gut tells me this is one of the types that moves around a lot (like InputMethod, MousePosition, UIEventArgs) between versions of TBC.
This has methods of OnUndo, OnRedo that fire when the buttons are clicked.
I believe you need to setup an observer (Reactive/Rx) on it, which you can do via the Subscribe method. It will have 2 args on the callback, 1 for type (Undo/Redo) and string (description from undo action).
If you setup an observer, it should allow you in the callback to monitor what happened.
Just a note on ITransactionTokenCommand, I do not think this is an interface provided from the TBC team.
It is definitely not in v2024.00 and I looked in v5.90 and couldn't find it. It may be something ANZ is doing themselves.
¯\_(ツ)_/¯
------------------------------
Bryce Haire
Original Message:
Sent: 06-17-2024 17:57
From: Ronny Schneider
Subject: how to catch a general Undo/Redo/delete event?
Would be interested in that topic as well. Especially for multithreading, since IronPython doesn't properly support it (it's slower than single threading).
Maybe Morteza can share a basic example?
------------------------------
Ronny Schneider
Original Message:
Sent: 06-17-2024 03:01
From: Fernando Calvo
Subject: how to catch a general Undo/Redo/delete event?
Hi,
is there any info in the community how to create macros with c# instead of IronPython? I would like to try that way too instead of all as until now via Python / IronPython.
Thanks.
Regards,
Fernando
------------------------------
Fernando Calvo
calvo@calvo-geospatial.com
Original Message:
Sent: 06-17-2024 02:36
From: ANZ Toolbox
Subject: how to catch a general Undo/Redo/delete event?
Hey Ronny, in C# we can implement the ITransactionTokenCommand interface. I am unsure how to do this using python macros. Hopefully you can figure it out or one of the Trimble guys can help you out!
------------------------------
https://tbcanz.com/anz-toolbox/
Original Message:
Sent: 06-17-2024 00:38
From: Ronny Schneider
Subject: how to catch a general Undo/Redo/delete event?
In some of the sample macros is shown how to catch the events for a single entity change. They use "Trimble.Vce.Core.ModelEvents".
ModelEvents.EntityAdded += self.test
But I don't want to use that, since that subroutine would be called potentially millions of times during a big Undo/Redo.
I just want the subroutine to run one time upon an Undo/Redo button click, or Ctrl+z or general delete (i.e. a file in the project explorer).
I couldn't find anything like "ProjectEvents".
Is "CalculateProject" always triggered in those cases and therefore
from Trimble.Vce.Core import CalculateProjectEventsCalculateProjectEvents.CalculateProjectEvent += self......
the proper way to go?
I'd prefer to distinguish between the different events though.
------------------------------
Ronny Schneider
------------------------------