Visio Guy

Visio Discussions => ShapeSheet & Smart Shapes => Topic started by: Yacine on May 23, 2010, 06:52:26 AM

Title: Duplicated shapes refering to their parent
Post by: Yacine on May 23, 2010, 06:52:26 AM
Been playing with duplicated shapes and wanted the next shape to remember it's predecessor in order to inherit certain properties (pinx,piny, height,...) to it's children.

The formulas are quite simple:
prop.nr=0
prop.parent=0
user.tempname=name()
user.parent is set automatically
EventDrop=SETF(GetRef(Prop.Parent),User.Name)
 +SETF(GetRef(User.Name),User.TempName)
 +SETF(GetRef(PinY),"=guard("&Prop.Parent&"!piny)")

the highlighted section is the one that binds a property to the parent.

That works pretty well, except that the inheritance starts only after the second duplication.

My head is too full, I can't figure out how to set properties for the first clone.

-----
It's actually similar to this:
http://visguy.com/vgforum/index.php?topic=680.0
 ... but you write the dependency formulas in the original shape instead of the first child. Guess that makes the saving in a template easier.
Title: Re: Duplicated shapes refering to their parent
Post by: Yacine on May 23, 2010, 03:48:42 PM
A visio file is better than 1000 posts...
Title: Re: Duplicated shapes refering to their parent
Post by: Jumpy on May 25, 2010, 07:05:18 AM
You should write
=User.Name in the Prop.Parent of the first shape, that it will work with already the first Strg+d.

As Prop.Parent will be set new with the SETFs in the EventDrop cell, this change means no problem for all following shapes.
Title: Re: Duplicated shapes refering to their parent
Post by: Yacine on May 25, 2010, 05:54:40 PM
Worked perfectly. Thank you very much.