public void toSketch(MECMOD.Factory2D oFactory2D) { MECMOD.Line2D oLine2D1 = oFactory2D.CreateLine(p1[0], p1[1], p2[0], p2[1]); MECMOD.Line2D oLine2D2 = oFactory2D.CreateLine(p2[0], p2[1], p3[0], p3[1]); MECMOD.Line2D oLine2D3 = oFactory2D.CreateLine(p3[0], p3[1], p4[0], p4[1]); MECMOD.Line2D oLine2D4 = oFactory2D.CreateLine(p4[0], p4[1], p5[0], p5[1]); MECMOD.Line2D oLine2D5 = oFactory2D.CreateLine(p5[0], p5[1], p6[0], p6[1]); MECMOD.Line2D oLine2D6 = oFactory2D.CreateLine(p6[0], p6[1], p7[0], p7[1]); MECMOD.Line2D oLine2D7 = oFactory2D.CreateLine(p7[0], p7[1], p8[0], p8[1]); MECMOD.Line2D oLine2D8 = oFactory2D.CreateLine(p8[0], p8[1], p1[0], p1[1]); }
public static void createAll(List <myRectangle> myRectanglesList, MECMOD.Sketch oSketch, INFITF.Application catiaInstance) { MECMOD.Factory2D oFactory2D = oSketch.OpenEdition(); double count = 0; foreach (myRectangle obl in myRectanglesList) { MECMOD.Line2D oLine2D1 = oFactory2D.CreateLine(obl.P1x, obl.P1y, obl.P2x, obl.P1y); MECMOD.Line2D oLine2D2 = oFactory2D.CreateLine(obl.P2x, obl.P1y, obl.P2x, obl.P2y); MECMOD.Line2D oLine2D3 = oFactory2D.CreateLine(obl.P2x, obl.P2y, obl.P1x, obl.P2y); MECMOD.Line2D oLine2D4 = oFactory2D.CreateLine(obl.P1x, obl.P2y, obl.P1x, obl.P1y); catiaInstance.set_StatusBar(Math.Round(count / myRectanglesList.Count * 100) + "%"); count++; } oSketch.CloseEdition(); }