Hi Richard,
kudos for coming up with such an elaborate code for your first macro. Any specific reason why you don't simply follow the example macros? I never had issues with the XAML not loading properly, and I always keep it as simple as possible. Your code for loading the UI looks overly complicate to me.
In a "StackPanel" macro that is running in the docked area I usually don't bother with "Grid" either. "Grid" is rather cumbersome to maintain if you decide to move controls around. In a floating window you must use "Grid" though.
Since Trimble is doing an outstanding job, besides no documentation in 8 years, by not keeping the sample macros available under Sample TMLs (TBC version 5.90) either, I've attached them to this message.
And still no SDK 2025.20; link for SDK 2024.10 has disappeared; latest available SDK is currently 2024.00;
You might find something useful here as well https://github.com/RonnySchneider/SCR_Macros_Public
I always declare the NumericEdits or DistanceControls directly in the XAML, load the XAML in "def __init__" and set the base values, upper/lower bounds for them in "OnLoad", or in a "def SetDefaultOptions". You can still do sanity checks there or in "OkClicked" as you did.
And what exactly is your macro trying to achieve? Extend the triangle slope down onto another surface/elevation plane? Or simply find the outer boundary and drop it vertically down onto the other surface? There might be simpler ways to do that.