- 积分
- 315
- 明经币
- 个
- 注册时间
- 2003-2-25
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
发表于 2003-4-18 13:06:00
|
显示全部楼层
我这有个以前求交点的程序,已调试通过!
我这有个以前求交点的程序,调试通过了,你先在Acad中画个矩形和一个圆相交,然后运行此程序,可得到交点。
Sub qjd()
Dim mo As AcadModelSpace
Set mo = ThisDrawing.ModelSpace
Dim intpoints As Variant
intpoints = mo(0).IntersectWith(mo(1), acExtendNone)
Dim i As Integer
Dim str As String
If VarType(intpoints) <> vbEmpty Then 'VarType(varname),必要的 varname 参数是一个 Variant vbEmpty返回值为0
For i = LBound(intpoints) To UBound(intpoints) Step 3
str = str & vbCrLf & "交点为:" & intpoints(i) & "," & intpoints(i + 1) & "," & intpoints(i + 2)
Next i
End If
MsgBox str
End Sub |
|