home *** CD-ROM | disk | FTP | other *** search
- /*
- @N
-
- This Genie will align a selection of points in an object to a user specified position
- */
-
- msg = PDSetup.rexx(2,0)
- units = getclip(pds_units)
- if msg ~= 1 then exit_msg(msg)
-
- counter = 0
- cr = '0a'x
-
- do forever
-
- point = pdm_ClickOnPoint("Select points to be aligned..")
- if word(point, 1) = "0" then break
-
- counter = counter + 1
- points.counter = point
- end
-
- if counter = 0 then exit_msg()
-
- selection = "Horizontally"cr"Vertically"
- selection = pdm_SelectFromList("Select options..", 25, 3, 0, selection)
- if selection = '' then exit_msg()
-
- ppos = pdm_GetPoint(word(points.1, 1), word(points.1, 2))
- x = word(ppos, 1)
- y = word(ppos, 2)
-
-
- if selection = "Vertically" then
- do
- istring = "position - hpos, 0"
- position = x
- end
- else
- do
- istring = "0, position - vpos"
- position = y
- end
-
- if units = 3 then position = pdm_ConvertUnits(1, units, position)
-
- position = pdm_GetForm("Enter alignment position..", 8, "Position:"position)
- if position = '' then exit_msg()
-
- if ~datatype(position, n) then exit_msg("Invalid entry")
- if units = 3 then position = pdm_ConvertUnits(units, 1, position)
-
- do i = 1 to counter
-
- obj = word(points.i, 1)
- pnt = word(points.i, 2)
- ppos = pdm_GetPoint(obj, pnt)
- hpos = word(ppos, 1)
- vpos = word(ppos, 2)
-
- interpret "call pdm_MovePoint(obj,pnt,"istring")"
-
- end
-
- exit_msg()
-
- exit_msg: procedure expose units
- do
- parse arg message
-
- if message ~= '' then call pdm_Inform(1,message,)
- call pdm_SetUnits(units)
- call pdm_AutoUpdate(1)
- exit
- end
-