ST6 : MinimumDistance Method

Solution Partner Creator Solution Partner Creator
Solution Partner Creator

Hello,

 

I need to display the minimum distance between two feature in my part document :

 

****


object element1 = null;


object element2 = null;

 

SolidEdgePart.EdgebarFeatures edges = part.DesignEdgebarFeatures;

 

foreach (object obj in edges)
{


string g = SolidEdgeCommunity.Runtime.InteropServices.ComObject.GetPropertyValue<string>(obj, "Name");

 

 

if (g.Equals("element1"))
{


element1 = obj;

}


if (g.Equals("element2"))
{
element2 = obj;

}

 


}

 

double dis;
Array point1 = new double[3];
Array point2 = new double[3];

part.MinimumDistance(element1, element2, out dis, ref point1, ref point2); -->A first chance exception of type 'System.Runtime.InteropServices.COMException' occurred

Console.WriteLine("Minimum Distance = " + dis);

****

Can someone help me please ?

How can I get the minimum distance between two elements in my part (ST6 )?

 

Thanks.

Mahbouba

1 REPLY

Re: ST6 : MinimumDistance Method

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom
Hi,
I didn't try this with a feature object but I think the method needs geometric objects like faces.
regards

JB
VS2015, SE ST10