如果有很多个坐标点,想简单的看一下彼此之间的相对位置关系,一个很简单的办法,就是展到AutoCAD中。在AutoCAD中逐点输入坐标数据肯定是不现实的,最简答的方法是在Excel中调用AutoCAD:
Global Sheet As Object, acadmtext As acadmtext, fontHight As Double
Global xlBook As Excel.Workbook
Global p0(2) As Double, p1(2) As Double, p2(2) As Double
Global acadApp As Object
Global acadDoc As Object
Global number As Integer, pt(2) As Double
Public Function GetAcad(dwt As String) As Boolean
Dim Face As String
Dim Bold As Boolean
Dim Italic As Boolean
Dim charSet As Long
Dim PitchandFamily As Long
On Error Resume Next
Set acadApp = GetObject(, "AutoCAD.Application")
If Err Then
Err.Clear
Set acadApp = CreateObject("AutoCAD.Application")
If Err Then
MsgBox "请安装AutoCAD 2000以上版本", vbCritical, "autocad"
Exit Function
On Error GoTo 0
GetAcad = False
Exit Function
End If
End If
Set acadDoc = acadApp.ActiveDocument
acadApp.Visible = True
GetAcad = True
acadDoc.ActiveTextStyle.GetFont Face, Bold, Italic, charSet, PitchandFamily
acadDoc.ActiveTextStyle.SetFont "宋体", Bold, Italic, charSet, PitchandFamily
0:
End Function
Public Function Draw_Point(Point() As Double) As AcadPoint
Set Draw_Point = acadDoc.ModelSpace.AddPoint(Point)
Draw_Point.Update
End Function
但如果计算机中装了多个版本的CAD,在调用过程中存在混淆,经查阅资料原来还有ProgID这个东西:
AutoCAD产品名 |
版本号 |