请教访问CAD的问题!(基本)
请各位帮忙看一下这个为什么不能运行:Sub sn()<BR>ThisDrawing.SendCommand "_line 0,100 319,100 "<BR>Dim i As Single<BR>Dim x As Single<BR>Dim y As Single<BR>pi = 3.1415926<BR>For i = 0 To 2 * pi Step 0.1<BR> x = 50 * i<BR> y = 100 + 75 * Sin(i)<BR> ThisDrawing.SendCommand "_point x,y "<BR>Next i<BR>End Sub
运行老提示,画的点无较,我是刚刚用VBA弄CAD以前老用LISP,请会的告诉一下<BR> Sub sn()<BR>ThisDrawing.SendCommand "_line 0,100 319,100 "<BR>Dim i As Single<BR>Dim x As Single<BR>Dim y As Single<BR>pi = 3.1415926<BR>For i = 0 To 2 * pi Step 0.1<BR> x = 50 * i<BR> y = 100 + 75 * Sin(i)<BR> ThisDrawing.SendCommand "_point " & x & "," & y & " "<BR>Next i<BR>End Sub VBA里尽量不用SendCommand,用AddXXX方法 哦,ADDXXX又是怎么个用法,我对这些一片空白,我呆的地方还卖不到这方面的书!!!望大家不吝指教! 画线可以用Thisdrawing.Modelspace.AddLine
画点可以用Thisdrawing.Modelspace.AddPoiint
建议楼主多看看对象模型<A href="http://www.mjtd.com/object/acad2004/" target="_blank" >http://www.mjtd.com/object/acad2004/</A>. 多看看书,或多看看帮助
页:
[1]