Layering Shapes On Shapes

C

consulttech2004

I am using Visio to layer shapes on shapes. Specifically, we are
using visio to draw a diagram of a building with electrical layouts.
I would like to have squares and rectangles in one layer and then have
other shapes (electrical components) in another layer. Easy enough.
THEN I would like to be able to tell (through code) which shape is on
top of which other shape. I am having trouble figuring out how to
write code that specifies where my rectangles are and where my
components are. Is there any easy way to write VBA to interrogate
which shapes rest upon others in a diagram?

Thanks in advance,

David
(A Visio Newbie)
 
A

Andy

You need to make use of the Visio methods such as SpatialNeighbors on
a shape. For example you could traverse all your rectangles and use
the SpatialNeighbors to find all the shapes contained in it. Also take
a look at SpatialSearch and SpatialRelation methods.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top