Author Topic: Adding shape to layer depending on shape property  (Read 107 times)

0 Members and 1 Guest are viewing this topic.

chris0702

  • Newbie
  • *
  • Posts: 2
Adding shape to layer depending on shape property
« on: September 12, 2017, 04: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

Yacine

  • Hero Member
  • *****
  • Posts: 2289
Re: Adding shape to layer depending on shape property
« Reply #1 on: September 13, 2017, 12: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
« Last Edit: September 13, 2017, 09:06:35 AM by Yacine »
Yacine

chris0702

  • Newbie
  • *
  • Posts: 2
Re: Adding shape to layer depending on shape property
« Reply #2 on: September 13, 2017, 03: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

Yacine

  • Hero Member
  • *****
  • Posts: 2289
Re: Adding shape to layer depending on shape property
« Reply #3 on: September 13, 2017, 11:00:11 AM »
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.
Yacine