CS_NXOpen_0006_createSpline




using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using NXOpen;
using NXOpen.UF;


namespace createSpline
{
    public class EX_Curve_Spline

    {
        private static UFSession theUfSession;
        private static Session theSession;


        public static void Main(string[] args)

    {


        theSession = Session.GetSession();
        theUfSession = UFSession.GetUFSession();

        
            // Create Spline curve1


        double[] bc1_knots = {-3.0/8.0, -2.0/8.0, -1.0/8.0, 0.0, 1.0/8.0,
                                     2.0/8.0, 3.0/8.0, 4.0/8.0, 5.0/8.0, 6.0/8.0,
                                     7.0/8.0, 1.0, 9.0/8.0, 10.0/8.0, 11.0/8};

        double[] bc1_poles = { 2.0, 0.0, 0.0, 1.0,
                                     4.0, 0.0, 0.0, 1.0,
                                     3.5, 2.0, 0.0, 1.0,
                                     6.0, 6.0, 0.0, 1.0,
                                     2.0, 3.5, 0.0, 1.0,
                                     0.0, 4.0, 0.0, 1.0,
                                     0.0, 2.0, 0.0, 1.0,
                                     0.0, 0.0, 0.0, 1.0,
                                     2.0, 0.0, 0.0, 1.0,
                                     4.0, 0.0, 0.0, 1.0,
                                     3.5, 2.0, 0.0, 1.0  };


        Tag curve_array;
        int knot1_fix;
        int pole1_fix;

        char[] buf = new char[UFConstants.UF_OBJ_NAME_BUFSIZE];
        String newnam = new String(buf);


        theUfSession.Modl.CreateSpline(11, 4, bc1_knots, bc1_poles, out curve_array, out knot1_fix, out pole1_fix);
        newnam = String.Copy("BCURVE_1");


        // Create Spline curve2




        double[] bc2_knots = {0.0, 0.0, 0.0, 1.0/3.0,
                                     2.0/3.0, 1.0, 1.0, 1.0};

        double[] bc2_poles = {0.0, 0.0, 1.0, 1.0,
                                     1.0, 2.0, 1.0, 1.0,
                                     0.625, 0.0, 0.25, 0.25,
                                     4.0, 2.0, 1.0, 1.0,
                                     5.0, 0.0, 1.0, 1.0 };


        int knot2_fix;
        int pole2_fix;



        theUfSession.Modl.CreateSpline(5, 3, bc2_knots, bc2_poles, out curve_array, out knot2_fix, out pole2_fix);
        newnam = String.Copy("BCURVE_2");


    }


    }
}


Comments

Popular posts from this blog

CS_NXOpen_0011_MoveBodies2Components

CS_NXOpen_0003_ProjectCurve

CS_NXOpen_0010_ExtrudeCurves