LengthIU doesn´t work

M

Markus B.

Hi ng,
I tried do to some calculations based on the length of
several Connector-Shapes. So I wrote this code to get the
length:

Private Function Get_Length (vsoConnector as Shape)
Dim dLength As Double
...
...
dLength = vsoConnector.LengthIU
Get_Length = dLength

End Function

This routine is called by a function which is called for
every connector. The connector is always 1D. But it
doesn´t work solid: dLength is often the same. Only in
debug-modus I get the correct length!!!???
I am also afraid that the LengthIU proberty returns the
shortest distance between the "Begin" and the "End" point
of the connector and not it´s real length.

Best regards
Markus
 
M

Mark Nelson [MS]

What version of Visio are you using?

--
Mark Nelson
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.


Hi ng,
I tried do to some calculations based on the length of
several Connector-Shapes. So I wrote this code to get the
length:

Private Function Get_Length (vsoConnector as Shape)
Dim dLength As Double
....
....
dLength = vsoConnector.LengthIU
Get_Length = dLength

End Function

This routine is called by a function which is called for
every connector. The connector is always 1D. But it
doesn´t work solid: dLength is often the same. Only in
debug-modus I get the correct length!!!???
I am also afraid that the LengthIU proberty returns the
shortest distance between the "Begin" and the "End" point
of the connector and not it´s real length.

Best regards
Markus
 
M

Markus B.

Hi Mark,
Visio 2002 Enterprise Edition (German)
Win2000 SP2 (German)

Thanks
Markus
 
M

Mark Nelson [MS]

Hmm. I was not able to reproduce the behavior using Visio 2002 English.
I'd be really surprised if the language version had anything to do with
this. Perhaps you can post a Visio file with a couple of connectors and the
code snippet below.

--
Mark Nelson
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.


Hi Mark,
Visio 2002 Enterprise Edition (German)
Win2000 SP2 (German)

Thanks
Markus
 
M

Markus B.

Hi Mark,
thank you for your help.
I posted my problems in the German Visio-NG, too. We / I
noticed that:
1. Visio 2003 (German) returns always 0 if Shape.LenghtIU
is called.
2. Visio 2002 (German) returns the correct lenght, but it
isn´t solid (my own experience).
3. The Visio-Window for size and position shows the the
shortest distance between the begin- and end-point of a
connector and not the real lenght ( eg spline).
4. The helpfile for LenghtIU is not clear ("Returns the
length (perimeter) of the object in internal units.")
Lenght and permiter are neither the same nor 0!
I am on a journey this week. So I can't answer new
postings until next monday. Where do I have to send my
buggy source?

Regards
Markus
 
M

Mark Nelson [MS]

Visio 2003 has a definite bug where LengthIU returns zero for paths that are
not closed (connectors). AreaIU may have the same problem.

I have not seen any issues with Visio 2002 and would like to know whether
you have a reproducible case you can show me to help investigate.

The Size & Position window should report Length as the distance between
endpoints.

The LengthIU automation method is designed to calculate the length of a
path. A path is the set of geometry segments in a Geometry section of the
Shapesheet. This is commonly the perimeter of the shape. For a connector,
it is the sum of the lengths of each line segment. I believe the algorithm
only looks at the first Geometry section in a shape. That may explain why
specific shapes generate strange results. It would not explain why the same
shape would produce different results at different times.

You can post your file to the NG or send it to me (remove "online" from
address to get real address).

--
Mark Nelson
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.


Hi Mark,
thank you for your help.
I posted my problems in the German Visio-NG, too. We / I
noticed that:
1. Visio 2003 (German) returns always 0 if Shape.LenghtIU
is called.
2. Visio 2002 (German) returns the correct lenght, but it
isn´t solid (my own experience).
3. The Visio-Window for size and position shows the the
shortest distance between the begin- and end-point of a
connector and not the real lenght ( eg spline).
4. The helpfile for LenghtIU is not clear ("Returns the
length (perimeter) of the object in internal units.")
Lenght and permiter are neither the same nor 0!
I am on a journey this week. So I can't answer new
postings until next monday. Where do I have to send my
buggy source?

Regards
Markus
 

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

Similar Threads


Top