Hi,
I wrote a simple code for you. This will prompt user a form to key in x and y coordinate.User can input scale as well.For eg: 1.5 2.6 2 (1.5 is x coord; 2.6 is y coord; and 2 is the scale) , or they can just input x and y coordinate only, for eg: 2.5 9.0
In the other hand, it will use ruler to create a marker at the coordinate.
procedure( ZoomToPoint( x y @key
(scale 1)
(winId hiGetCurrentWindow())
(cvId geGetEditCellView()))
let(( (dx 2) (dy 2))
;----------------------------
; Zoom to point with scale
;----------------------------
hiZoomWindowAtPoint(winId scale x:y)
printf("\nCmd: Zooming to Point %L %L with scale %L\n" x y scale)
;-------------------------------
; Create cross mark using ruler
;-------------------------------
leCreateRuler( cvId list(x:y x+dx:y+dy))
leCreateRuler( cvId list(x:y x+dx:y-dy))
leCreateRuler( cvId list(x:y x-dx:y+dy))
leCreateRuler( cvId list(x:y x-dx:y-dy))
);let
);proc
procedure( zoomGUI()
let(()
;----------------
; Create form
;----------------
hiCreateAppForm(
?name 'zoomGui
?formTitle "Zoom and Mark"
?callback "zoomGuiCB(zoomGui->column->value)"
?fields list(
list( hiCreateStringField(
?name 'column
?prompt "Go to:"
) 5:5 200:25 50)
);
?buttonLayout 'OKCancel
?help ""
);
hiDisplayForm(zoomGui)
);let
);proc
procedure( zoomGuiCB(input)
let((dX dY (zscale 1))
value = parseString(input " ")
;-----------------------
; Process form' value
;-----------------------
if( length(value) == 2 then
dX = atof(car(value))
dY = atof(cadr(value))
else
if( length(value) == 3 then
dX = atof(car(value))
dY = atof(cadr(value))
zscale = atof(caddr(value))
else
warn("Zoom to Pt => Invalid input! Input must be x y scale")
);if
);if
;--------------------------
; Calling function to zoom
;--------------------------
ZoomToPoint(dX dY ?scale zscale)
);let
);proc
How