﻿using System;

public class Form1
{

	private void Button1_Click(object sender, EventArgs e)
	{
		SolidEdgeFramework.Application objApp = null;
		SolidEdgePart.PartDocument objDoc = null;
		SolidEdgePart.Sketches3D objSketches3D = null;
		SolidEdgePart.Sketch3D objSketch3D = null;

		double[] pointArray = new double[13];
		object[] lineArray = new object[3];

		lineArray[0] = null;
		lineArray[1] = null;
		lineArray[2] = null;
		try
		{

			// Create/get the application with specific settings
			objApp = Microsoft.VisualBasic.Interaction.GetObject(null, "SolidEdge.Application");

			// open the document mentioned in the doc files.
			objDoc = objApp.Documents.Add("SolidEdge.PartDocument");

			objSketches3D = objDoc.Sketches3D;

			// Now add new sketch
			objSketch3D = objSketches3D.Add();

			///Create array of double values
			pointArray[0] = 0.0;
			pointArray[1] = 0.1;
			pointArray[2] = 0.2;

			pointArray[3] = 0.3;
			pointArray[4] = 0.4;
			pointArray[5] = 0.5;

			pointArray[6] = 0.6;
			pointArray[7] = 0.7;
			pointArray[8] = 0.8;

			pointArray[9] = 0.9;
			pointArray[10] = 0.11;
			pointArray[11] = 0.17;

			objSketch3D.AddEx(pointArray, lineArray);

		}
		catch (Exception ex)
		{
			Microsoft.VisualBasic.Interaction.MsgBox(ex, ToString);
		}
		finally
		{
			objApp = null;
			objDoc = null;

		}

	}
}
