The Omni Group
These forums are now read-only. Please visit our new forums to participate in discussion. A new account will be required to post in the new forums. For more info on the switch, see this post. Thank you!

Go Back   The Omni Group Forums > OmniGraffle > OmniGraffle General
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Possible to Create Spatial Offset from Line to Shape/Object? Thread Tools Search this Thread Display Modes
I have a particular style from Illustrator that I'm trying to replicate. I'm pretty close (and I can live with what I've got).

The one thing I'm 'graffling' with a little is seeing if it's possible to create a spatial separation between lines and objects while still using magnets. So, for example, I've got a line connected to an object using objects. Good. But they're in direct contact with each other and I'd like to create a small visual space between them that Omnigraffle manages. (I just prefer the way it looks).

In the attached example, you can see the spacing from the line that starts from the circle with 'BEGINNING...' in it and then terminates on the rectangle with 'Process (1)' in it. (This example I did w/ Illustrator). Some shapes in the example don't have the spacing (like the line relative to the circle). That's fine- if I could figure out a way to do it I'd be fine just doing it across the board.
Attached Thumbnails
Click image for larger version

Name:	ProcTemp_SCRATCH.png
Views:	884
Size:	43.6 KB
ID:	2675  
I would do this with File > New Resource > New Stencil making myself a new stencil containing a set of the basic shapes I needed, in which each shape was grouped (Arrange > Group ⌘⇧G) with a similar but slightly larger shape, which:
  1. is behind it,
  2. shares its centre,
  3. has neither fill nor stroke,
  4. and has the magnet pattern that you want

to simply provide the invisible fringe.

Once you have prepared your stencil, you can drag from it as many copies as you need of each specially prepared shape, and there will automatically be gaps at the start and end of any connecting arrows between such shapes.

(And, of course, if you submit your new stencil to Graffletopia, you will find it available through the stencil window on any machine on which you subsequently use OmniGraffle).

Attached Thumbnails
Click image for larger version

Name:	TwoPartShapes.png
Views:	1613
Size:	12.6 KB
ID:	2676   Click image for larger version

Name:	ViewMagnets.png
Views:	1678
Size:	11.2 KB
ID:	2677  

Last edited by RobTrew; 2013-01-03 at 12:41 AM.. Reason: Corrected typo: Template → Stencil
To automate the process of building a stencil of shapes with invisible margins, you could:
  1. Select some shapes with the required dimensions and magnets,
  2. run the script below.

(Adjust the value of pMargin to fine-tune the gap between arrows and shapes)

(Perhaps you could use this to derive a margin-framed version of an existing process stencil)


property pTitle : "Make invisible frame for selected shape(s)"
property pVer : "0.05"

property pMargin : 15

property pDoubleMargin : pMargin * 2

on run
	tell application id "OGfl"
		tell front window
			set lstSeln to selection
			if length of lstSeln < 1 then return
			set lstNewSeln to {}
			repeat with shpBase in lstSeln
				set shpBase to contents of shpBase
				if class of shpBase is shape then
					set {lstOrigin, lstSize, lstMagnets} to {origin, size, magnets} of shpBase
					-- Calculate the position and dimension for the framing shape
					repeat with i from 1 to 2
						set item i of lstOrigin to (item i of lstOrigin) - pMargin
						set item i of lstSize to (item i of lstSize) + pDoubleMargin
					end repeat
					-- Make a frame (copying the magnets from the base shape) and group the two
					tell its canvas
						set shpFrame to make new shape at end of graphics with properties {fill:no fill, draws stroke:false, draws shadow:false, magnets:lstMagnets, origin:lstOrigin, size:lstSize}
						set end of lstNewSeln to (assemble {shpFrame, shpBase})
					end tell
				end if
			end repeat
			set selection to lstNewSeln
		end tell
	end tell
end run

Last edited by RobTrew; 2013-01-03 at 06:17 AM.. Reason: Corrected z order of components to improve text handling, and allowed for multiple selections
Rob, I can't imagine a more perfect answer. Thanks.

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't detach a line from an object countdrachma OmniGraffle General 2 2011-08-16 07:21 PM
How to create key-value pairs when creating a shape ianpiper OmniGraffle General 15 2011-08-12 12:27 PM
Object/Shape Size, copying of miinwa OmniGraffle General 1 2010-10-29 04:52 PM
Create new smart shape? ramatsu OmniGraffle General 0 2010-10-26 09:55 PM
Line connection only to outside of shape? mikejt OmniGraffle General 2 2007-08-08 10:28 AM

All times are GMT -8. The time now is 10:56 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.