|
马上注册,结交更多同行朋友,交流,分享,学习。
您需要 登录 才可以下载或查看,没有帐号?注册
x
那位帮着给看看,我写的这个样条曲线错在哪儿了?
Dim swApp As SldWorks.SldWorks
Dim Part As SldWorks.ModelDoc2
Dim boolstatus As Boolean
Dim sketchSpl() As SketchSpline
Dim Px(10) As Double
Dim Py(10) As Double
Dim i As Long
Sub main()
Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
boolstatus = Part.Extension.SelectByID("前视基准面", "LANE", 0, 0, 0, False, 0, Nothing)
Part.ClearSelection2 True
Px(0) = 0
Px(1) = 0.314
Px(2) = 0.628
Px(3) = 0.942
Px(4) = 1.256
Px(5) = 1.57
Px(6) = 1.884
Px(7) = 2.199
Px(8) = 2.513
Px(9) = 2.827
Py(0) = 0
Py(1) = 0.309
Py(1) = 0.587
Py(2) = 0.809
Py(3) = 0.951
Py(4) = 1
Py(5) = 0.951
Py(6) = 0.951
Py(7) = 0.809
Py(8) = 0.587
Py(9) = 0.309
ReDim sketchSpl(10)
For i = 0 To 9
Set sketchSpl() = Part.SketchSpline(i, Px(i), Py(i), 0)
Next i
Part.ViewZoomtofit2
End Sub |
|