Reply

A chain of edges in PSM - how to meassure total length?

[ Edited ]

Hi there,

 

I'm trying to meassure a total length of edges, added to the "AttachedPropertyTable" object.

 

There's no problem to meassure single edges - the method GetLengthAtParam works fine.

 

 private static double GetLengthAtParam(Edge e, int start, int stop)
{
try
{
double dlugosc;
e.GetLengthAtParam(start, stop, out dlugosc);
return dlugosc;
}
catch (Exception ex)
{
Debug.WriteLine(ex.Message);
return 0;
}
}

The problem is, when I try to meassure an Edge from a chain. I become (every time) a Com Exception E_FAIL.

The code is more than simple - iterating with for/foreach via Edges object (cast is correct!):

Edges ee2 = (Edges)o;
foreach(Edge e in ee2)
{
           cutLength += GetLengthAtParam(e, 0, 200);
}

Every Edge meassured with first code sample throws an E_FAIL. 

 

What's wrong? Or how to meassure the total length in the other way?