Hello
To answer ".PL":
I can't integrate your "words" into my macro, "FreePointcurveFeatureData:: PointArray".
To answer "gt22":
I have already created a macro that creates a XYZ curve FUNCTION, attached,
Otherwise I tried to create a macro that creates a curve VIA a sketch but it doesn't work :(,
(I wanted to create a curve via a sketch because it's easier to edit later"
macro FUNCTION curve: (works)
Dim swApp As SldWorks.SldWorks
Dim Part As SldWorks.ModelDoc2
Dim boolstatus As Boolean
Dim longstatus As Long, longwarnings As Long
Dim skiP As Object
Dim myRefPlane As Object
Dim skSegment As Object
Sub main()
Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
Open "Folder Path\TC.txt" For Input As #1
Part.InsertCurveFileBegin
Do While Not EOF(1)
Input #1, X, Y, Z
boolstatus = Part.InsertCurveFilePoint(X / 1000, Y / 1000, Z / 1000)
Loop
Close #1
boolstatus = Part.InsertCurveFileEnd()
boolstatus = Part.SelectedFeatureProperties(0, 0, 0, 0, 0, 0, 0, True, False, "spline stem") 'NAME SPLINE 'spline stem'
End Sub
macro SKETCH curve :(not working) Help!
Dim swApp As SldWorks.SldWorks
Dim Part As SldWorks.ModelDoc2
Dim boolstatus As Boolean
Dim longstatus As Long, longwarnings As Long
Dim skSegment As Object
Dim pointArray As Variant
Dim points() As Object
Sub main()
Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
Open "Folder Path\TC2.txt" For Input As #1
boolstatus = Part.Extension.SelectByID2("Face Plane", "PLANE", 0, 0, 0, False, 0, Nothing, 0)
Part.SketchManager.InsertSketch True
ReDim points(0 To 2) As Object
Do While Not EOF(1)
Input #1, X, Y, Z
points(0) = X / 1000
points(1) = Y / 1000
points(2) = Z / 1000
Loop
Close #1
Set skSegment = Part.SketchManager.CreateSpline((pointArray))
Part.SketchManager.InsertSketch True
End Sub