I saw a similar question being asked twice recently and thought I would address it here. The questions were from Fusion 360 users but it also applies to Inventor. The specific question was “How to create a 3D spline where the control points are determined by parameters?”
The first thing to discuss is what exactly you’re controlling. The question was about controlling the shape of a spline but it could also be about changing the end point of a line or the center of a circle. The good news is that the same answer applies to any sketch geometry. The important thing to understand is that all sketch geometry, in both Fusion 360 and Inventor, is controlled by sketch points. When you drag and change the position of the end of a line you’re really just dragging a sketch point and the line is attached to that so it moves. The same is true with the center of a circle. The point you see at the center isn’t just for convenience so you can easily see where the center is but it’s a real sketch point that controls the position of the circle. Splines are the same. When you create a spline and click to define a fit point, Fusion 360 or Inventor, creates a sketch point and the spline fits through and is dependent on that point. You modify the shape of the spline by moving the point.
By understanding that the position of sketch geometry is controlled by sketch points, that changes the original question to “How do I control the position of sketch points using parameters?” That’s what I want to explain here. If we look at a single point in a sketch and want to precisely control its position we can add dimension constraints to it, like shown below.
I created the sketch on the X-Y construction plane, (or work plane in Inventor), so all points on the plane will have a Z value of 0. (I’ll use the term “construction plane” for the remainder of this post.) The dimensions are between the origin point and the sketch point I want to control so the values specify the X and Y offset from the model origin. When the dimensions were placed, model parameters were automatically created and the dimension is dependent on them. The picture below shows the two parameters with their default names of d1 and d2 in the Fusion 360 Parameters dialog.
It’s wise to rename these as you go along so you can easily identify which dimension controls which point. I’ve renamed them to point1_x and point1_y, as shown below.
That’s really the answer to question and you just build on that idea to be able to control a spline using parameters. You’ll just have more points and a lot more parameters. Below is an example of a spline and it’s controlling parameters. When creating a spline you can draw the spline first and then dimension to the points that were automatically created or you can draw the points first and then fit the spline through the existing sketch points. Either approach will create the same result so it’s just a matter of which seems the easiest for you. For me, I think creating the points first can be a little easier because it’s easier to understand which parameter goes with which point when you just have one or two.
Now by editing the parameter values I can easily modify the curve to an exact desired shape, as shown below.
I posted previously showing a model that I built and animated using exactly this same technique. The picture below shows the result but it’s all accomplished by editing the values of parameters which in turn control the positions of points that splines fit through and then various features were created using those splines.
Controlling the Z Value
The above illustrates how to control the X and Y position of a sketch point, which it typically all that’s needed. However in some cases you might also want to control the Z position. First you need to decide if you really need to control the Z position or if using a plane that is positioned other than on the model X-Y plane will work. You can create the sketch in any arbitrary plane and dimension the points from any arbitrary point so it doesn’t always have to be from the model origin but that is common to have coordinate data relative to the model base coordinate system.
In Fusion 360, all sketches are 3D so sketch points can exist anywhere in space and aren’t limited to being on the x-y plane of the sketch. However, if you move a point out of the x-y plane you can’t control the z offset using a dimension which means it’s only the x-y position that can be controlled by a dimension and the associated parameter. Inventor is the same except that 2D and 3D sketches are different types of sketches. What I’ve discussed so far is for 2D sketches.
For both Fusion 360 and Inventor, the way to control the Z height is by using construction planes. Assuming we want to control the x-y-z position of a point relative to model space, you’ll first create a construction plane that is an offset from the X-Y base construction plane. When you create an offset construction plane, Fusion 360 and Inventor automatically create a parameter that controls the offset distance of the construction plane. You’ll then create the sketch that contains the points on that construction plane. The offset distance of the construction plane now controls the Z height of all points on that sketch and the dimension constraints to those points defines the X and Y positions. If every point needs to have independent Z values that means a new offset construction plane and sketch for each point.
If you end up with points in different sketches then you have some additional work. In Inventor you need to create a new 3D sketch and create a new spline by selecting the points as the points to fit the spline to. In Fusion 360 it’s also easy but you have to change a preference setting to allow the creation of a spline off of the x-y plane of the sketch. That preference setting is highlighted below.
Now you have full control of the x, y, and z positions of a sketch point.
Using the API
Another option for controlling the position of sketch points is to use the API in either Fusion 360 or Inventor. There are two ways to use the API to control the position of a sketch point. In the example of the melting butter I created points whose positions were controlled by parameters like I’ve already talked about and then used a Python script to change the values of the parameters. That’s illustrated in the melting butter post. Another approach is to not use parameters at all and use the API to move the points to the desired location. That’s possible but also has it’s own issues, like finding the point you want to move. Using the API to directly move a point is a bit beyond the scope of this post but I wanted to mention it in case it’s something that might better fit your needs.