[ 本帖最后由 rainingdidadi 于 2005-11-5 00:54 编辑 ]作者: rainingdidadi 时间: 2005-11-5 00:47
夜深人静
继续贴
可以用宏来实现
我录的如下:
' ******************************************************************************
' C:\DOCUME~1\user\LOCALS~1\Temp\swx1308\Macro1.swb - macro recorded on 11/04/05 by user
' ******************************************************************************
Dim swApp As Object
Dim Part As Object
Dim boolstatus As Boolean
Dim longstatus As Long, longwarnings As Long
Dim FeatureData As Object
Dim Feature As Object
Dim Component As Object
Sub main()
Dim x, y, pi, z, t
pi = 3.1415926
Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
boolstatus = Part.Extension.SelectByID2("前视基准面", "PLANE", 0, 0, 0, False, 0, Nothing, 0)
Part.InsertSketch2 True
Part.ClearSelection2 True
Part.InsertSketch2 True
Part.InsertCurveFileBegin
For t = 0 To pi Step 0.1 '这里决定转几圈
x = 0.02 * Cos(t * 360 * 3) * t
y = 0.02 * Sin(t * 360 * 3) * t
z = (Sqr(Sqr(Sqr(t)))) ^ 3 * 0.05
Part.InsertCurveFilePoint x, y, z
Next t
Part.InsertCurveFileEnd
End Sub
运行,曲线就出来了作者: rainingdidadi 时间: 2005-11-5 00:53
有的地方是教人用excel来做的
生成文本文件,中间用tab隔开,麻烦!!!
假如那些点是从坐标机来的,当然是用excel方便拉
知道方程的情况下,我们就要和excel 说88了