PDA

View Full Version : locking magnets during object resize?


krustyfur
2006-06-30, 09:48 AM
I have custom magnets on two shapes with lines connecting the two shapes. When I resize the objects, the magnets shift position - they seem to maintain a relative positioning. I then have to select each magnet and move them back to where they were. This is very tedious as I don't know exactly what size I want a shape when I first draw it.

Is there any way to lock the magnets so they maintain some kind of absolute positioning during a resize?

Thanks

Chris

Dan Thomsen
2006-12-04, 01:03 PM
If you place them by hand the magnets are off by a little bit. You could use applescript to place them exactly.

The coordinately system places the object center at 0,0 and scales the object to a size of 1.


-- select an objects to add magnets to in omnigraffle

-- these are examples lists of points for each edge of an object
-- the two corners and the middle each get a magnet

set left_edge to {{-0.5, -0.5}, {-0.5, 0}, {-0.5, 0.5}}
set right_edge to {{0.5, -0.5}, {0.5, 0}, {0.5, 0.5}}
set bottom_edge to {{-0.5, 0.5}, {0, 0.5}, {0.5, 0.5}}
set top_edge to {{-0.5, -0.5}, {0, -0.5}, {0.5, -0.5}}

tell front window of application "OmniGraffle Professional"

-- this will add magnets to all selected objects
set objects to selection

repeat with obj in objects
set magnets of obj to left_edge
end repeat
end tell