/* addanno.aml /* /* Called by: addanno.menu /* labelanno.menu /* Calls made: msg.menu /* /* Description: Adds annotatino from user points or to a line &args textinput placement string /* Check if string entered &if [null %string%] &then &do &s .ae$msg Text string not entered &thread &create msg &menu msg &pos ¢er &thread addanno &pinaction ~ '&thread &focus &on &all' &stripe 'Message!' &return &end /* then do /* Change coordinate input to MOUSE &if [show coordinate] ne MOUSE &then &do &ty Changing coordinate input to MOUSE COORDINATE MOUSE &s .ae$coordinate MOUSE &end /* then do /* Create new annotation record ADD NEW /* Check if input of text string is by user or from a label item &if %textinput% eq USER &then ANNOTEXT [unquote %string%] &else &do /* when textinput eq label or atlabel /* The variable string is the item whose value will be used as the text string ANNOFEATURE LABEL %string% &ty \Select label to obtain text string from ANNOSELECTFEATURE * &if [extract 1 [show annoselectfeature]] gt 0 &then ANNOTEXT FEATURE &else &do &ty \No label feature selected &return &end /* else do &end /* else do /* When input is not from user, check if annotation is to be placed at label /* feature or specified by user &if %textinput% eq ATLABEL &then &do /* check if annotation is to be placed at 90 degrees &if [quote %placement%] eq '90' &then &do /* first point for placing the annotation at 90 degrees are the label coord &s jpnt$x [extract 2 [show annoselectfeature]] &s jpnt$y [extract 3 [show annoselectfeature]] &ty \Enter a point above label for annotation to read upward or &ty below label for annotation to read downward &call 90 &end /* then do &else &do ANNOPLACE FEATURE &end /* else do &s .ae$annostring [show [show ef] [show select 1] text] &end /* then do &else &do /* Add annotation based on placement selection by user &select %placement% &when points; &do &ty \Place the annotation &tty ANNOPLACE * &end /* when points &when line; &do ANNOFEATURE LINE /* select line and position to place annotation &ty \Select line to position annotation &ty (annotation will be upside-down when selection is made below line) ANNOSELECTFEATURE * &if [extract 1 [show annoselectfeature]] gt 0 &then ANNOPLACE FEATURE &else &ty \No line selected &end /* when line &when 90; &do ANNOFIT OFF &ty \Enter justify point for annotation to add at 90° &getpoint &map &s jpnt$x %pnt$x% &s jpnt$y %pnt$y% &ty \Enter second point above first point for annotation to read upward &ty or below first point for annotation to read downward &call 90 &end /* when 90 &end /* select placement &s .ae$annostring [show [show ef] [show select 1] text] &end /* else do &return &routine 90 &getpoint /* set displacement 2cm between points at 1 : 250000 scale map &s displacement [calc 2 * ( 250000 / 100 ) ] COORDINATE KEYBOARD XY &mess &off ANNOPLACE * &if %pnt$y% gt %jpnt$y% &then &do /* Annotation reading up &select [show annoposition] &when LL, CL, UL, LU, CU, UU; &do %jpnt$x%, %jpnt$y% %jpnt$x%, [calc %jpnt$y% + %displacement%] [unquote ' '] &end &when LC, CC, UC; &do %jpnt$x%, [calc %jpnt$y% - ( %displacement% / 2 ) ] %jpnt$x%, [calc %jpnt$y% + ( %displacement% / 2 ) ] [unquote ' '] &end &when LR, CR, UR; &do %jpnt$x%, [calc %jpnt$y% - %displacement%] %jpnt$x%, %jpnt$y% [unquote ' '] &end &end /* select &end /* then do &else &do /* Annotation reading down &select [show annoposition] &when LL, CL, UL, LU, CU, UU; &do %jpnt$x%, %jpnt$y% %jpnt$x%, [calc %jpnt$y% - %displacement%] [unquote ' '] &end &when LC, CC, UC; &do %jpnt$x%, [calc %jpnt$y% + ( %displacement% / 2 ) ] %jpnt$x%, [calc %jpnt$y% - ( %displacement% / 2 ) ] [unquote ' '] &end &when LR, CR, UR; &do %jpnt$x%, [calc %jpnt$y% + %displacement%] %jpnt$x%, %jpnt$y% [unquote ' '] &end &end /* select &end /* else do &ty 1 annotation added and updated with new coordinates COORDINATE MOUSE &mess &on &return