Change Degrees or Curvature or Continuity G0, G1, G2, G3 from a Curve with API

Change Degrees or Curvature or Continuity G0, G1, G2, G3 from a Curve with API

florian_wenzel
Advocate Advocate
307 Views
2 Replies
Message 1 of 3

Change Degrees or Curvature or Continuity G0, G1, G2, G3 from a Curve with API

florian_wenzel
Advocate
Advocate

Hi,

Inventor 2024

API Visual Studio C# or VB.NET

 

i have a Question,  is there a way to modify or change the Curvature of the Curve.

I think in Inventor as Default is G3, correct me if im wrong.

Is there a Way to Change this for example to G2 or G1 etc...

 

I was found nothing in CurveEvaluator and etc...

 

florian_wenzel_0-1697642608906.png

 

here some Links: Autodesk Inventor 2D surface curvature comb graphs (cadsetterout.com)

https://www.youtube.com/watch?v=LySx2At5yZs

 

Code:

// only begining

 

 

 

using Inventor;
using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Win32;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows.Forms;
using InvAddIn;
using Part_Code_CS;


namespace InvAddIn
{
    internal class CommandFunctionButton_18
    {
        public static void CommandFunctionfweButton_18()
        {
            PartDocument oPartDoc = (PartDocument)Globals.g_inventorApplication.ActiveDocument;
            PartComponentDefinition oCompDef = oPartDoc.ComponentDefinition;
            TransientGeometry oTG = Globals.g_inventorApplication.TransientGeometry;
            TransientObjects oTO = Globals.g_inventorApplication.TransientObjects;
            TransientBRep oBRep = Globals.g_inventorApplication.TransientBRep;
            MeasureTools oMeasureTools = Globals.g_inventorApplication.MeasureTools;
            CommandManager oCommandManager = Globals.g_inventorApplication.CommandManager;

            Sketch3D oSketch_A = oCompDef.Sketches3D.Add();
            Sketch3D oSketch_B = oCompDef.Sketches3D.Add();

            Point oPoint_A = oTG.CreatePoint(1, 4, 0);
            Point oPoint_B = oTG.CreatePoint(4, 1, 0);
            Point oPoint_C = oTG.CreatePoint(1, 1, 0);

            ObjectCollection oObjColl = oTO.CreateObjectCollection();
            oObjColl.Add(oPoint_A);
            oObjColl.Add(oPoint_C);
            oObjColl.Add(oPoint_B);

            SketchControlPointSpline3D oSpline = oSketch_A.SketchControlPointSplines3D.Add(oObjColl);
            BSplineCurve oBSplineCurve = oSpline.Geometry;
            CurveEvaluator oCurveEvaluator = oBSplineCurve.Evaluator;

        }
    }
}

 

 

 

Thanks for any Sugestion

 

 

0 Likes
308 Views
2 Replies
Replies (2)
Message 2 of 3

florian_wenzel
Advocate
Advocate

Correct me if im wrong, maybe i understand here something wrong.

 

I want to reach a Goal something like this:

 

florian_wenzel_2-1697644127031.png

 

 

 and now i realize, that i need 2 ControlPoints and it will Solve the Problem 🙂

 

Question, is Possible to get a Result like the Red Curve, but only with One ControlPoint ?

Even Changing the G3 to G2 or G1, will change here Something, when i have 3 Points as Input?

I mean, StartPoint, EndPoint and One ControlPoint.

Or is this so, that since i will have minimum 2 ControlPoints, it will have a influance the G3 or G2 or G1?

0 Likes
Message 3 of 3

Michael.Navara
Advisor
Advisor

I'm not sure you can modify the SketchControlPointSpline when position of control points are fully constrained.

Possible solution can be when you use SketchSpline instead. Then you can get point handles and edit them as you need.

0 Likes