Closed CesarAero closed 8 months ago
Looks like a bug.
The create_spline class method needs to be rewritten using a VB method. Not sure when I'll get a chance to do that right now.
What exactly are you trying to do at the spline_tuple = (*ctrl_pt_1,*ctrl_pt_2,*ctrl_pt_3)
part?
I was trying to create a pytjon tuple since an i_tuple
is required as input for the function create_spline(i_poles: tuple)
Just do spline_tuple = (ctrl_pt_1.com_object, ctrl_pt_2.com_object, ctrl_pt_3.com_object)
that should work for now :)
@evereux PR for this https://github.com/evereux/pycatia/pull/200
Nice. I hadn't looked into this much.
Thanks for this. Great stuff.
You're welcome. You could also take a look at my other 2 PRs if you got the time. :)
Just do
spline_tuple = (ctrl_pt_1.com_object, ctrl_pt_2.com_object, ctrl_pt_3.com_object)
that should work for now :)
wow it worked thanks!!
Yeah I saw those, thanks again.
I'm hoping to get these all merged by the end of the week.
@CesarAero after the changes are merged in version 0.6.7, it will work with spline_tuple = (ctrl_pt_1, ctrl_pt_2, ctrl_pt_3)
. Just so you won't be surprised in the future.
Closing as improvements made by @mokrueger are now in release 0.6.7.
Dear support,
I am trying to create a spline inside a sketch by using create_spline and create_control_point with the following code:
# Create sketch in plane_ZX
sketch_3 = sketches.add(plane_ZX)
sketch_3.name = "spline"
ske2D_3 = sketch_3.open_edition()
# Spline coordinates
L=100
ctrl_pt_1 = ske2D_3.create_control_point(-L, L/2)
ctrl_pt_2 = ske2D_3.create_control_point(0, L/4)
ctrl_pt_3 = ske2D_3.create_control_point(L/2, L)
spline_tuple = (*ctrl_pt_1,*ctrl_pt_2,*ctrl_pt_3)
ERROR HERE!ske2D_3.create_spline(spline_tuple)
# sketch close edition
sketch_3.close_edition()
# Update the document
document.part.update()
However the
spline_tuple
that is fed into thecreate_spline
command is not able to containsketcher_interfaces.control_point_2D.ControlPoint2D
type objects.How could I succesfully pass the points into the spline?
Thank you in advance!