6 Replies Latest reply on Jan 3, 2018 10:24 PM by Moon Wang

    problem with api when get sketch

    Moon Wang

      hello,I want to get sketches and contours by api GetSketchContours after get 3d sketches between  some refPlanes intersect with compoment faces .A picture may explain this question.I have already got 3d sketches by coding ,and I haved  .

      Now I can count that the SketchContourCount is 48 at this sketch,however,when I get SketchContourCount by api ,the return number  is 44.and when I get Edge by object[] VEdges = (object[])swContour.GetEdges(),certain some edgeVEdges[ i ] is null when I debug,so  I am very confused,there may be some questions I haven't considered. Some of my program code is as belows.

       

       

      I get contours by this :

                    int swContourCount = swSketch.GetSketchContourCount();

                                      object[] skContours = (object[])swSketch.GetSketchContours();

                                        for (iContour = skContours.GetLowerBound(0); iContour <= skContours.GetUpperBound(0); iContour++)//Contour

                                      {

                                                                              object[] VEdges = (object[])swContour.GetEdges();

                                          for ( m = VEdges.GetLowerBound(0); m <= VEdges.GetUpperBound(0); m++)//edge

                                          {

                                              edgeNum = VEdges.GetUpperBound(0);

                                              swEdge = (Edge)VEdges[m];

                                              swCurve = swEdge.IGetCurve();

      }

      }

      //Can someone give me some suggestions,thank you