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

Position Image on an Object in a Relative Positon So It Maintains Relative Position but no Resize Thread Tools Search this Thread Display Modes
I have a project where I need
a) basic rectangle that I can move around, resize, etc. that has
b) one of several fixed size images riding along imposed on the rectangle's lower, left corner.

In the attached image, the rectangle to the left has the compliant look. The one the right show the two items. I put magnets on the image but from what I understand only magnets that are on alternatively an object and a connector attract.

Do you see a way to do this?

Things I've done and tried-
1. Place it by hand each time- labor intensive but workable (the option of last resort)
2. Group the shapes- not great because I often need to resize the rectangle and I don't want the circle to resize.
3. Make a connector to bind them that has a fixed length of near zero (seemed kludgey so didn't spend a lot of time on it)
3. Make the image think it's a connect- not sure how to do this or if it's possible

Any suggestions would be much appreciated. Thanks.
Attached Thumbnails
Click image for larger version

Name:	grafflling.png
Views:	783
Size:	56.4 KB
ID:	2679  
I have another related item related to the question of 'Is there a way to group things but keep size static?'.

On each of the rectangles I use, I have a circle w/ an arrow attached to it that enumerates the shape (example attached). I'd like this to grip the magnet as I move the rectangle and resize it, but not resize and I'd like it to maintain it's position relative to the rectangle/the magnet where it's attached.

Attached Thumbnails
Click image for larger version

Name:	grafflingII.png
Views:	647
Size:	41.7 KB
ID:	2680  
One approach would be to group the main shape with its (two or more) satellite shapes, and use a script (perhaps at a late stage of editing) to batch-correct any satellite size distortions that have arisen during resizing of the groups.

For this to work, satellite shapes would need to be tagged (with user data, as in the Inspectors > Note dialog) with their normal dimensions (before they are included in a group), so that a script can restore these dimensions later. A simple tagging script can do this to selected shapes:

-- Tag selected shape with its own dimensions

property plstTags : {"Width", "Height"}

tell application id "OGfl"
	repeat with oSeln in (selection of front window) as list
		tell oSeln
			set lstSize to size
			repeat with i from 1 to 2
				set value of user data item (item i of plstTags) to (item i of lstSize) as string
			end repeat
		end tell
	end repeat
end tell
As long as the satellite shapes have these "Width" and "Height" tags, the normal width, height and position of any such satellites can be restored at any point by selecting their enclosing groups, and running a script along the lines of:

property pTitle : "Restore satellite dimensions (and link length) within selected (resized) group(s)"
property pVer : "0.03"

property plstTags : {"Width", "Height", "LinkLength"}

tell application id "OGfl"
	repeat with oSeln in (selection of front window) as list
		tell oSeln
			if class = group then
				set refGraphics to (a reference to its graphics)
				set {lstSizes, lstOrigins, lstData} to {size, origin, user data} of refGraphics
				repeat with i from 1 to length of lstSizes
					if item i of lstData is not missing value then
						set {rWidth, rHeight} to {0, 0}
						tell item i of refGraphics
								set rWidth to (value of user data item (item 1 of plstTags)) as number
								set rHeight to (value of user data item (item 2 of plstTags)) as number
							end try
							if rWidth > 0 and rHeight > 0 then
								set {lstSize, lstOrigin} to {item i of lstSizes, item i of lstOrigins}
								set {rDX, rDY} to {(item 1 of lstSize) - rWidth, (item 2 of lstSize) - rHeight}
								if rDX ≠ 0 then set item 1 of lstOrigin to (item 1 of lstOrigin) + rDX / 2
								if rDY ≠ 0 then set item 2 of lstOrigin to (item 2 of lstOrigin) + rDY / 2
								set {origin, size} to {lstOrigin, {rWidth, rHeight}}
							end if
							-- If a Link Length is specified, adjust distance of satellite from nearest edge of main shape
							set rLength to 0
								set rLength to (value of user data item (item 3 of plstTags)) as number
							end try
							-- Find any horizontal or vertical (incoming or outgoing) link
							if rLength ≠ 0 then
								set {lstIn, lstOut} to {incoming lines, outgoing lines}
								set {lngIn, lngOut} to {length of lstIn, length of lstOut}
								if lngIn > 0 then
									set {rHoriz, rVert} to size of (item 1 of lstIn)
								else if lngOut > 0 then
									set {rHoriz, rVert} to size of (item 1 of lstOut)
								end if
								-- if a link was found then correct its length (by moving the satellite)
								if (lngIn + lngOut) > 0 then
									set lstOrigin to origin
									if rVert > rHoriz then
										set origin to {item 1 of lstOrigin, (item 2 of lstOrigin) + (rLength - rVert)}
										set origin to {(item 1 of lstOrigin) + (rLength - rHoriz), item 2 of lstOrigin}
									end if
								end if
							end if
						end tell
					end if
				end repeat
			end if
		end tell
	end repeat
end tell
Attached Thumbnails
Click image for larger version

Name:	NormalDimensions.png
Views:	1441
Size:	39.6 KB
ID:	2681   Click image for larger version

Name:	Before.png
Views:	671
Size:	17.1 KB
ID:	2682   Click image for larger version

Name:	After.png
Views:	679
Size:	19.1 KB
ID:	2683  

Last edited by RobTrew; 2013-01-05 at 04:48 AM..
(You could, of course, prepare a stencil of groups in which the satellites had these Width and Height tags)
You could also add a "LinkLength" property to the linked (numbered) satellite, if you want the script to correct its distance from the lower edge of the main shape (as well as correcting its proportions).

Attached Thumbnails
Click image for larger version

Name:	LinkLength.png
Views:	1335
Size:	50.4 KB
ID:	2684  

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
Thread Thread Starter Forum Replies Last Post
relative dates avandelay OmniFocus for iPhone 0 2010-07-27 01:59 PM
Relative repeating dates RFBriggs OmniFocus 1 for Mac 1 2010-06-04 10:53 AM
Relative Actions HunterBoss OmniGraffle General 0 2009-10-10 09:15 AM
Relative Dates For Tomorrow Toadling OmniFocus 1 for Mac 0 2009-09-30 05:17 PM
Set Tasks Relative To End Date? vicchi OmniPlan General 7 2008-03-28 04:19 PM

All times are GMT -8. The time now is 07:34 PM.

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