cancel
Showing results for 
Search instead for 
Did you mean: 

G1 Constraint in Spline

Pioneer
Pioneer

Dear All,

 

I wrote a VB Program for  automating a time consuming modeling process in our company.

 

In part of this process I want to specify G1 constraint between 2 existing Splines in Sketch environment. But don't 'now how to do that.

In other word I want to set G1 between end point of the first Spline and start point of the second one.

 

If someone could point me in the right direction, that would be awesome!

Sina shojaee
4 REPLIES

Re: G1 Constraint in Spline

Phenom
Phenom

What version of NX?

Have you tried recording a journal?

Re: G1 Constraint in Spline

Pioneer
Pioneer
Dear cowski1,
I use NX 9
Yes I recorded a journal but I can't edit it correctly to find end point of the first spline and first point of the next spline to apply G1 constraint.
Sina shojaee

Re: G1 Constraint in Spline

Legend
Legend

There are several methods for achieving this.  They all involve getting the poles next to the common spline end pole in line.  It all depends on the importance of preserving the splines shape.  One relatively simple method is to move two poles as shown in the image.

 

Image2.jpg

Consider the left hand spline the poles are shown as the blue circles.  The larger blue circle is moved to the large red circle position.  The line construction is just to show what I did.  The same was done for the right hand spline.  You can see the difference between the splines.

 

As mentioned before if the spline shape is important an other way is to increase the order of the splines so that when the spline poles are moved the affect is less severe.  A further method is to increase the knots.

 

Frank Swinkels

Re: G1 Constraint in Spline

Genius
Genius

Hello Sina!

 

Assuming that you already have the splines as Splines-Objects you can use the following code to get the startpoint:

 

NXOpen.Spline spline1 = ... (your first spline . You want to get the endpoint)
NXOpen.Expression startParameterValueExpr = workPart.Expressions.CreateSystemExpression ("0.00000");
NXOpen.Scalar startParameterValueScalar;
startParameterValueScalar = workPart.Scalars.CreateScalarExpression(startParameterValueExpr, NXOpen.Scalar.DimensionalityType.None, NXOpen.SmartObject.UpdateOption.WithinModeling);
NXOpen.Point startPoint;
startPoint = workPart.Points.CreatePoint(spline1, startParameterValueScalar, NXOpen.SmartObject.UpdateOption.WithinModeling);

This code creates a point at the parametervalue '0' of a spline (usually the startpoint). To get the endpoint of a spline the parametervalue has to be '1'. As long as you are using non-periodic splines NX will norm the

knot vector from '0' to '1'.

 

Hope that helps! :-)

 

flo