What's new

multiple Splines

EngineeringDude

New Member
I am trying to import two splines :
# create part
MyPart = Part('Hump',CreateNew=False)
# add sketch on XY plane
PointSketch = MyPart.AddSketch('HumpSketch', MyPart.GetPlane('XY-Plane'))
# add points with lines connecting them
PointSketch.AddBspline(points, False)
PointSketch.AddRectangle(-4,-0,7,3,False)
PointSketch.AddBspline(points2, False)

instead of two splines and a rectangle, i get a rectangle with one spline (the combo of a spline if i concatenate points and points2 - ie a loop as below vs two independent splines )

Also, can I add to an existing 2d sketch vs needing to create a new one (MyPart.ConnectToSketch - or something)

1682302370164.png
 

EngineeringDude

New Member
i figured it out - wasn't resetting the points so points2 had the both curves.

still cant figure out how to connect to a current sketch vs having to make a new one
 

EngineeringDude

New Member
MyPart = Part('WALLX',CreateNew=False)
print MyPart.DisplayUnits()

displays inches but it imports as mm (my darwing is 25.4 times smaller than expected)
 

NateLiquidGravity

Alibre Super User
To get the part session that the Alibre Script is running in without knowing the name you can use:
MyPart = CurrentPart()

To get an existing sketch you can do something like this but you need a sketch name:
MySketch = MyPart.GetSketch("Sketch<1>")


For units you need to set them in each Alibre Script like:
Units.Current = UnitTypes.Inches

You need to checkout the Alibre Script Manual - I believe it has these answers and much more helpful info.
 
Top