- 积分
- 444
- 明经币
- 个
- 注册时间
- 2005-6-2
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
我用 sendcommand 创建直线出现一些问题,请求各位大哥指点,程序如下
Sub myl() Dim ptpick As Variant Dim x As Double Dim y As Double Dim x1 As Double Dim y1 As Double ptpick = ThisDrawing.Utility.GetPoint(, "请选择第一点") x = ptpick(0) y = ptpick(1)
ptpick = ThisDrawing.Utility.GetPoint(, "请选择下一点") x1 = ptpick(0) y1 = ptpick(1)
ThisDrawing.SendCommand ("_line" & vbCr & "x,y,0" & vbCr & "x1,y1,0" & vbCr) End Sub
但是同样是差不多的代码,画圆的时候就可以
Sub mycircle() Dim ptpick As Variant Dim x As Double Dim y As Double Dim z As Double ptpick = ThisDrawing.Utility.GetPoint(, "请选择第一点") x = ptpick(0) y = ptpick(1) z = 0 static r as Double Dim returnString As String returnString = ThisDrawing.Utility.GetString(False, "输入半径:") If returnString = "" Then r = r Else r = Val(returnString) End If ThisDrawing.SendCommand ("_Circle" & vbCr & "x, y, 0" & vbCr & r & vbCr) End Sub
请教各位高手! |
|