The ConstructExtended of IConstructCurve does not work??how to solve??

507
1
05-09-2012 05:41 AM
wxd
by
New Contributor
Hello,I want ot create a extension line of a line to extended to the desstination line, so I used the   ConstructExtended of  IConstructCurve , but it does not work, the follow is my code, and I use the arcobject 10.0 and vs 2010 to code it?How to solve this problem, because in VS 2005 and AE 9.2 , it tested correctly.

here is my code:

    IPoint pPt = new PointClass();
     IPolyline slopeLine = new PolylineClass();
     slopeLine.FromPoint = startPt;
     slopeLine.ToPoint = CreatePointByAngleDistance(startPt, radAngle,  50);
     slopeLine.SpatialReference = pSR;
     IConstructCurve2 pConCurve = new PolylineClass();
     bool isExtensionPerfomed = false;
   ICurve pCurve1 = slopeLine as ICurve;
    ICurve pCurve2 = desLine as ICurve;
    pConCurve.ConstructExtended(pCurve1,pCurve2, (int)esriCurveExtension.esriDefaultCurveExtension,ref isExtensionPerfomed);
    pPt = slopeLine.ToPoint;
0 Kudos
1 Reply
DuncanHornby
MVP Notable Contributor
Looking at your code extract it appears OK, but you should confirm that the polyline slopeLine is valid, try putting in a message box to return the length of slopeLine. If this was you expected then something else is going wrong.
0 Kudos