Listing 2d points in a sketch

Top  Previous  Next

To get hold of the coordinates of 2d points in a 2d sketch look at this example:

 

   gLogger.Printf(ekLogMsg, L"There are %d points in the sketch", pNewSketch->SketchPoints->Count);

   for (long p = 1; p <= pNewSketch->SketchPoints->Count; p++) {

       CComPtr<SketchPoint> pTempSketchPoint;

       pNewSketch->SketchPoints->get_Item(p,&pTempSketchPoint);

       CComPtr<Point2d> pCoords;

       pTempSketchPoint->get_Geometry(&pCoords);

       gLogger.Printf(ekLogMsg, L"Point %3d is %.2f %.2f",p, pCoords->GetX(), pCoords->GetY());

   }

 

 

Text, images and diagrams © 2021 Owen F. Ransen. All rights reserved. (But copy the source code as much as you want!)