本人入错行,进入建筑,接触了cad。
下面的两段代码可以在autocad里面产生正弦曲线。
注意要单步调试,按住不停,若一下调试可能会死机。
此文写于2007年年末。
made by correy
QQ:112426112.
Email:leguanyuan@126.com
Sub CreatePoint()
Dim pointObj As AcadPoint
Dim location(0 To 2) As Double
Dim a As Double
Dim b As Double
a = 0
Do Until a = 9
b = Sin(a)*5
a = a + 0.1
location(0) = a#: location(1) = b#: location(2) = 0#
Set pointObj = ThisDrawing.ModelSpace.AddPoint(location)
ZoomAllDim pointObj As AcadPoint
Dim location(0 To 2) As Double
Dim a As Double
Dim b As Double
a = 0
Do Until a = 9
b = Sin(a)*5
a = a + 0.1
location(0) = a#: location(1) = b#: location(2) = 0#
Set pointObj = ThisDrawing.ModelSpace.AddPoint(location)
Loop
End Sub Sub CreatePoint()
Dim pointObj As AcadPoint
Dim location(0 To 2) As Double
Dim a As Double
Dim b As Double
a = 0
Do Until a = 0.9
b = Sin(a) * 2
a = a + 0.01
location(0) = a#: location(1) = b#: location(2) = 0#
Set pointObj = ThisDrawing.ModelSpace.AddPoint(location) ZoomAll
Loop
End Sub
没有评论:
发表评论