2 Replies Latest reply on May 26, 2014 3:35 AM by Allen Liu

# how to get divided segment of the start and end point?

When I selected a edge and got total distance.

How to get divided segment of the start and end point?

Can you give me a hand?

private void CalPoint(int segment)
{
double[] vStarPoint = new double;
double[] vEndPoint = new double;
Edge swedge = _edgeList; //selected edge

Curve swcur = (Curve)swedge.GetCurve();
CurveParamData curparam = (CurveParamData)swedge.GetCurveParams3();

//edge total length
Double edgelen = (Double)swcur.GetLength3(curparam.UMinValue, curparam.UMaxValue) * 1000;

Vertex startVertex = swedge.GetStartVertex();
Vertex endVertex = swedge.GetEndVertex();

//get Start and End Vertex points.
vStarPoint = startVertex.GetPoint();
vEndPoint = endVertex.GetPoint();

//calculate equidistant length's segment
Double tempLen = edgelen / segment;

//How to get  divided  segment start and end point?

//???

}

• ###### Re: how to get divided segment of the start and end point?

You need to evaluate the edge at parameter. Try this method: Edge::Evaluate2.

• ###### Re: how to get divided segment of the start and end point?

I rewrite new code. but then result is not correct.  Could you help me to point out what's wrong?

private void CalPoint(int segment)
{
double[] vStarPoint = new double;
double[] vEndPoint = new double;
Edge swedge = _edgeList;

if (swedge == null) return;

Curve swcur = (Curve)swedge.GetCurve();
CurveParamData curparam = (CurveParamData)swedge.GetCurveParams3();

//edge total length
Double edgelen = (Double)swcur.GetLength3(curparam.UMinValue, curparam.UMaxValue) * 1000;

Vertex startVertex = swedge.GetStartVertex();
Vertex endVertex = swedge.GetEndVertex();

//get Start and End Vertex points.
vStarPoint = startVertex.GetPoint();
vEndPoint = endVertex.GetPoint();

//calculate equidistant length's segment
Double tempLen = edgelen / segment;

double[] vSegPoint=new double;
IModelDoc2 pDoc;