Author Topic: How can I access parent group's Shape.ID when dropping shapes?  (Read 3857 times)

0 Members and 1 Guest are viewing this topic.

kennyj

  • Jr. Member
  • **
  • Posts: 38
How can I access parent group's Shape.ID when dropping shapes?
« on: December 20, 2012, 03:57:47 PM »
Hello -

I'm using Visio 2010 Premium and I'm struggling to figure out how to make shapes within a group interact via shapesheet.

Would someone please explain how to get the parent group's id from within a shape?

Basically, what I'm doing is dropping shapes onto a group, and I want the shapes to automatically size and position themselves based on characteristics of the group or other shapes within the group.

I think I understand how to accomplish that, if I could somehow generically reference the parent group's id, without knowing in advance what that id is, but I've been completely befuddled trying to get access to that info.

For instance, setting the formula of the shape's Width cell to something like "=Sheet.2!.Width" works great, if the group happened to be Sheet.2, but how do I find out what the group's actual id is?

I really appreciate any help!

Thanks,

Kenny-J



 

Jumpy

  • Hero Member
  • *****
  • Posts: 1061
Re: How can I access parent group's Shape.ID when dropping shapes?
« Reply #1 on: December 21, 2012, 02:35:15 AM »
When working with shapesheet alone, you have to know GroupID in advance. Therefore you'll need to use VBA.

kennyj

  • Jr. Member
  • **
  • Posts: 38
Re: How can I access parent group's Shape.ID when dropping shapes?
« Reply #2 on: December 21, 2012, 03:17:03 AM »
When working with shapesheet alone, you have to know GroupID in advance. Therefore you'll need to use VBA.

Wow, that is so surprising! Explains why it was so hard to find though :p
Thanks very much for your reply, Jumpy!
I'll have to think it through a bit more now, but I'm guessing I could use a container to kind of kludge a solution, given the ContainerSheetRef() function.