(sw2012 及 swp文件)
' *****************************
' 零件翼片擺動之概念宏
' *****************************
Dim swApp As Object
Dim Part As Object
Dim boolstatus As Boolean
Sub main()
Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
Dim myDimension As Object
Set myDimension = Part.Parameter("D1@平面1")
Set myModelView = Part.ActiveView
pi = Atn(1) * 4 '圓周率
For i = 60 To 120 Step 2 '翼片拍下角度之循環
A = i * pi / 180 '角度轉弧度
myDimension.SystemValue = A
boolstatus = Part.EditRebuild3()
myModelView.RotateAboutCenter 0, 0
Next i
For j = 118 To 60 Step -2 '翼片提起角度之循環
A = j * pi / 180 '角度轉弧度
myDimension.SystemValue = A
boolstatus = Part.EditRebuild3()
myModelView.RotateAboutCenter 0, 0
Next j
Debug.Print "end"
End Sub
本帖最后由 ryouss 于 2019-1-11 15:51 编辑
有如上概念,再來海闊天空任你翱"想"了!
本帖最后由 ryouss 于 2019-1-12 16:22 编辑
參考
页:
1
[2]