View Single Post
Here is an example of how to specify 16 evenly distributed points for the selected shape(s). You can add or reposition custom points by specifying them in virtual coordinates that extend from top left {-1.0, -1.0} down to bottom right {1,1}.

This script gives the cardinal directions, the four corners, and midpoints between corners and edge centres. You can adjust the point lists to whatever you like. There is no need for any kind of symmetry.

Code:
-- SIMPLE MAGNET EXAMPLES, North-South, East-West, and four corners 
property plstNSMagnets : {{0.0, -1.0}, {0.0, 1.0}}
property plstEWMagnets : {{1.0, 0.0}, {-1.0, 0.0}}
property plstCornerMagnets : {{1.0, 1.0}, {1.0, -1.0}, {-1.0, -1.0}, {-1.0, 1.0}}
property plstQuarterPoints : {{-0.5, -1}, {0.5, -1}, {1, -0.5}, {1, 0.5}, {-0.5, 1}, {0.5, 1}, {-1, 0.5}, {-1, -0.5}}

tell application id "OGfl"
	tell front window
		repeat with oGraphic in (selection) as list
			if class of oGraphic = shape then
				set magnets of oGraphic to plstNSMagnets & plstEWMagnets & ¬
					plstCornerMagnets & plstQuarterPoints
			end if
		end repeat
	end tell
end tell

Last edited by RobTrew; 2012-02-19 at 12:36 AM..