I have been working on a script that will do the following:
1) Select pixels in the active surface from a drawing polygon (UI script - transfer selection)
2) Crop the surface to the selection (Analyzer script)
3) Transform the cropped surface (UI script - Transform)
4) Transfer heights from the transformed surface to points in a drawing.
A couple of issues; a) Can anyone help with renaming a column in the points drawing within the script for (4) above? Essentially the issue is that the UI dialogue for Transfer Heights sends the heights to a "Heights" column, which gets overwritten each time. I would like to rename the column from "Heights" to the name of the surface from which the heights came, so that on the next iteration of the script the "Heights" column can receive the new data and then get renamed etc.
b) as the UI scripting involves some dialogues that are only available within the Map component, can anyone suggest some code to cycle through all the surfaces in the Map with the above script/workflow?
The script for 4) is below:
Dim UI, Dlg
Set UI = Application.UserInterface
' Wait for dialog to show (to avoid timing issues)
Do ' Nothing
Loop Until UI.DisplaysModalDialog
Do ' Nothing
Loop Until UI.ModalDialog.Caption = "Transfer Heights"
Set Dlg = UI.ModalDialog
.Item("ComboBoxSource").Text = "[Application.ActiveWindow.ActiveComponent.Name]"
.Item("ComboBoxTarget").Text = "POINTS"
.Item("ComboBoxTargetColumn").Text = "Application.ActiveWindow.ActiveComponent.Name"