Visio Guy

Visio Discussions => ShapeSheet & Smart Shapes => Topic started by: Bald Eagle on November 15, 2015, 07:22:24 PM

Title: retaining shapesheet references with copy / paste
Post by: Bald Eagle on November 15, 2015, 07:22:24 PM
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!
Title: Re: retaining shapesheet references with copy / paste
Post by: Surrogate on November 15, 2015, 07:35:11 PM
try use syntax GUARD(Sheet.XXX!Width)
where XXX is ID of Rectangle's shape
Title: Re: retaining shapesheet references with copy / paste
Post by: Bald Eagle on November 15, 2015, 07:39:21 PM
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.
Title: Re: retaining shapesheet references with copy / paste
Post by: Yacine on November 15, 2015, 08:06:10 PM
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.
Title: Re: retaining shapesheet references with copy / paste
Post by: Bald Eagle on November 15, 2015, 08:17:24 PM
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?
Title: Re: retaining shapesheet references with copy / paste
Post by: Bald Eagle on November 15, 2015, 11:48:09 PM
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.
Title: Re: retaining shapesheet references with copy / paste
Post by: Bald Eagle on November 15, 2015, 11:58:24 PM
It seems like this:
http://visguy.com/vgforum/index.php?topic=680.0 (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.
Title: Re: retaining shapesheet references with copy / paste
Post by: wapperdude on November 16, 2015, 02:24:37 AM
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
Title: Re: retaining shapesheet references with copy / paste
Post by: Bald Eagle on November 16, 2015, 02:06:44 PM
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.
Title: Re: retaining shapesheet references with copy / paste
Post by: Yacine on November 16, 2015, 05:02:39 PM
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.
Title: Re: retaining shapesheet references with copy / paste
Post by: Bald Eagle on November 16, 2015, 05:09:43 PM
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   :)