Visio Guy

Visio Discussions => ShapeSheet & Smart Shapes => Topic started by: chris0702 on September 12, 2017, 09:51:22 PM

Title: Adding shape to layer depending on shape property
Post by: chris0702 on September 12, 2017, 09:51:22 PM
Hello everyone,

I'm trying to figure out a way to change the membership of a shape to a layer depending on a shapes property.
In my specific case each shape has a status e.g new, relocate, exchange etc... which I can change in a drop-down list. The shapes should then all be in the according layer depending on the selection in this list. I try to figure a way without vba, so I started getting the list of layer of the page I'm currently on in a user cell. My idea was then to do a lookup through this list to get the index of the specific layer and be than able to change the layer-membership of the shape according to that number. As the thepage!layers.name function gives me an array and not a list with semicolons, lookup is not working. Can you think of a way to convert this array to a list or to directly lookup in the layers.name array? Or maybe there is also a different way to solve the task.

Thanks,

Christian
Title: Re: Adding shape to layer depending on shape property
Post by: Yacine on September 13, 2017, 05:13:13 AM
Hi Christian,
in the post below the shapes get assigned to a layer automatically, the layers list is however edited manually. Have try.
http://visguy.com/vgforum/index.php?topic=8019.0 (http://visguy.com/vgforum/index.php?topic=8019.0)
Title: Re: Adding shape to layer depending on shape property
Post by: chris0702 on September 13, 2017, 08:15:41 AM
Hi Yacine,

I already know this thread, but hoped for a possibility to do this automatically. If there is no other possibility, I can also think of an ugly nested if formula to go through all items in the layers.name array to produce the list my self.

Christian
Title: Re: Adding shape to layer depending on shape property
Post by: Yacine on September 13, 2017, 04:00:11 PM
Hello Chris,
I played a little bit with your request, but did not find a really satisfactory solution. Especially as a small VBA routine would easily do the job and alternatively editing manually a list of layers (at page level) should not be a problem.