retaining shapesheet references with copy / paste

Started by Bald Eagle, November 15, 2015, 07:22:24 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Bald Eagle

Hi All,

I'd like to be able to control the properties of multiple shapes, representing holes, by resizing one "control shape" in a drawing.   I tried to edit the shapesheet values of one shape
=GUARD(Rectangle!Width)
=GUARD(Rectangle!Height)

but when I copy and paste that new shape, expecting to have the reference to the "control shape" stay intact, I get
=GUARD(REF())
=GUARD(REF())

Is there a way I can get these formulas to be retained during copy/paste, is there some other completely different thing that i need to be doing?

This is in VISIO 2007. 
Thanks!

Surrogate

try use syntax GUARD(Sheet.XXX!Width)
where XXX is ID of Rectangle's shape

Bald Eagle

I tried that after reading a bunch of articles and posts, but VISIO automagically edited the formula with "sheet1.rectangle!width" to be just "rectangle".
I don't know why or what I'm doing wrong.

Yacine

#3
I presume, that the problem does not happen when copy paste a shape on the drawing, but when dropping the shape from a stencil (even the document stencil) on the page.

The problem seems to be, that masters in a stencil can't keep references to other shapes. However references to a page or a doc property work very well. (=thepage!prop.xxx). Use this to control the size of your hole shapes.

Alternatively you could write the formula dynamically on drop of the shape. (Write in the shape dropped field in the events section in the shapesheet: SETF(Getref(width),"Guard(rectangle!width)")+SETF(Getref(height),"Guard(rectangle!height)"). But this is very inelegant, because the formula depends on another shape having to be on the page.

HTH,
Y.
Yacine

Bald Eagle

Nope, I drag a master onto a drawing page, copy/paste it to make a second shape, edit the second shape's shape sheet, then copy/paste that edited shape to try to make a 3rd and subsequent shapes.

I'm editing the Shape Transform section - I'm guessing that might be the wrong place to edit?

Bald Eagle

I just tried putting the references to the original shape's width and height into the user-defined section, and then making W&H referenced to User.Row_#, but that didn't work either.

It seems like this ought to be trivial default behaviour, like $column$row in Excel, but maybe it's more convoluted than that.

Bald Eagle

It seems like this:
http://visguy.com/vgforum/index.php?topic=680.0
is pretty much what I want to do, but I think i need a bit more explanation on how to do it from scratch.

wapperdude

Can you up load a sample, over preferred.  I don't think we have a complete picture of what you're trying to do. 

Wapperdude
Visio 2019 Pro

Bald Eagle

Thank you,

I just want to have one shape that is user resizable, and all the other shapes will change size along with that shape.   I thought that making one shape that did that and then copying it multiple times would work, so i didn't have to edit the formulas in every other shape would work, but it doesn't.

Yacine

Hi Bald Eagle,
I cannot explain it, but the workaround is to avoid the clipboard.
Either:
- drag the shape while holding the ctrl key pressed,
- or duplicate the shape by pressing ctrl+d
Regards,
Y.
Yacine

Bald Eagle

Quote from: Yacine on November 16, 2015, 05:02:39 PM

- drag the shape while holding the ctrl key pressed,
- or duplicate the shape by pressing ctrl+d

Ha!  That works.  I was completely unaware of those two tricks.
(I've been using VISO since the 90's, but only casually.)
Thanks so much, Yacine.  I'm sure that I can learn a lot here from all the VISIO users and experts.
I'll likely have some more silly questions that are just as easily answered.

Thanks again   :)