Force Shape to Center on Container

Started by Nteger, July 27, 2011, 02:42:53 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Nteger

I thought I had this figured out at one point, but now I'm not so sure.

I have a container that accepts only one kind of shape. So far, I have it so that the shape width matches the container's width and expands with it. The problem I'm having is getting the shape's PinX to match the container's PinX. By default, it doesn't do this, because that would just make too much sense :o. I've tried a couple different options here:

1: If I set the shape's PinX = CONTAINERSHEETREF(1)!PinX, the shape just inherits the page location of wherever it is dropped, and the formula is lost.

2: If I set the shape's PinX = GUARD(CONTAINERSHEETREF(1)!PinX), sometimes it works as intended, but other times, especially if there are two containers in the same row, the dropped shape inherits the PinX of its master shape on the shape editing page. For some reason it doesn't join the container. Plus, since the PinX is guarded, I can't just drag it onto the container.

3: I also tried using an IF statement. GUARD(IF(CONTAINERCOUNT()<>0,CONTAINERSHEETREF(1)!PinX,FALSE)). However, I get the same result as before; the dropped shape doesn't join the container and inherits 0 for PinX.

Why isn't the dropped shape joining the container consistently? Is there a way to get it to?
Instead of using FALSE or some arbitrary number, is there a way to force the shape to inherit its PinX based on where it's dropped on the page (its default behavior)?
Is there some easier way to get this to work that I've just overlooked?

Thanks!

Nteger

Answered by the Visio Guy himself at MSDN: http://social.msdn.microsoft.com/Forums/en-US/visiogeneral/thread/eb98734b-5ee9-4075-a525-2a402137036f

The formula I'm using now is PinX = IFERROR(CONTAINERSHEETREF(1)!PinX,SETATREFEXPR(4.25 in)) and everything works as intended.