Hi,
I have a data table consisting of coordinates X, Y and a column named Bin.
I would like to keep the initial columns and transform those to new columns with coordinates called Xn and Yn.
Then I have a window with a button box that calls a function that mirrors the Y-coordinates. When I push the button, the command works, but just for a split second, before the coordinates are turned back to their initial values. I just see a short flash with the reversed sign.
Can you help me out?
Thanks for your help
dt = Current Data Table();
Try(dt << Delete column (:Xn)); //deletes existing Xn and Yn in case script is run several times
Try(dt << Delete column (:Yn));
dt << New Column ("Xn", Numeric, Continuous, Formula(:X));
dt << New Column ("Yn", Numeric, Continuous, Formula(:Y));
New Window("DS Map Alignment",
Button Box ("Mirror Y Axis",
MirrorFunction)
);
MirrorFunction = Function({},
NewX = :Xn << Get Values();
NewY = :Yn << Get Values();
dt:Xn << Set Values (NewX);
dt:Yn << Set Values (-NewY); //This is where I mirror the Y coordinates
);