how can I test whether or not a group member is within its group?

R

Reinier Post

Dear Visio group,

Visio (2000 and 2002) allows shapes within groups to be taken outside
their containing groups. I'd like to test for this condition, even on
unfilled groups (NoFill TRUE).

But SpatialNeighbors and its relatives won't let me do it.
No matter what arguments I supply,

x.SpatialNeighbors(y,...)

never returns True when x.ContainingGroup = y or y.ContainingGroup = x,
regardless of their relative positions. I have varied the spatial
relation, the IterationMode of the result, and the ResultRoot argument.

This means that I can see no way at all to use these routines for
my intended purpose, except by temporarily modifying the diagram
prior to testing. But that introduces problems with undoing, etcetera.

A Visio document with some code to illustrate the effect:

http://www.win.tue.nl/~rp/visio/spatialneighbors-for-group-containment.vsd

At this moment, I'm using my own handcoded overlap tests,
but they are slow.

Am I missing something? Is there a better way?
 
R

Royce

I think the SpatialNeighbors funtion is just plain broken. In my case the function works but only when I'm trying to find the neighbors of a shape that has been rotated between 0 and 45 degrees. Above 45 degrees it starts missing neighbors it should find and above 65 degress it doesnt find any neighbors regardless

Visio 2003 is just as broken as 2000 and 2002. I don't think they plan to fix the function.
 
J

John Marshall, MVP

Can you post some sample code that shows this effect?

John... Visio MVP

Royce said:
I think the SpatialNeighbors funtion is just plain broken. In my case the
function works but only when I'm trying to find the neighbors of a shape
that has been rotated between 0 and 45 degrees. Above 45 degrees it starts
missing neighbors it should find and above 65 degress it doesnt find any
neighbors regardless.
Visio 2003 is just as broken as 2000 and 2002. I don't think they plan to
fix the function.
 

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