将你的工程保存在任意位置
2、在CAD工具,加载应用程序中将你的工程放在启动组中
3\自定义菜单,菜单中的命令按钮定义属性为:-VBARUN TOO即可.
顺一门有百福 平安二字值千金 万象更新
VBA有相应 *** 作EXCEL的函数。大概思路是 ,在选取块的同时。读取块的数据,存入excel。
下面是一个excel与CAD交互的例子。这样的例子百度应该会很多。
http://club.excelhome.net/thread-1138785-1-1.html
Private Sub MyList()Dim ssetObj As Object 'AcadSelectionSet
Dim i As Long
corner1(0) = 0: corner1(1) = 0: corner1(2) = 0
corner2(0) = 1000: corner2(1) = 1000: corner2(2) = 0
On Error GoTo Err1
' Create the selection set
If Not IsNull(AcadDoc.SelectionSets.Item("SSET")) Then
Set ssetObj = AcadDoc.SelectionSets.Item("SSET")
ssetObj.Delete
End If
Err1:
Set ssetObj = AcadDoc.SelectionSets.Add("SSET")
Dim mode As Integer
Dim minPoint, MaxPoint
i = 0
mode = 1 'acSelectionSetCrossing
ssetObj.Select mode, corner1, corner2
Dim ENT As Object
For Each ENT In ssetObj
If ENT.EntityName = "AcDbText" Then
i = i + 1
Cells(i, 1) = ENT.TextString
End If
Next ENT
End Sub
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)