我想用VB往一张CAD图里添加另一个块,不知道为什么我的程序运行出来图片没有变化
PrivateSubcmdInsert_Click()DimiAsLongDimjAsLongFori=0ToFile1.ListCount-1IfFile1.Selec...
Private Sub cmdInsert_Click()
Dim i As Long
Dim j As Long
For i = 0 To File1.ListCount - 1
If File1.Selected(i) Then
AcadApp.Documents.Open File1.Path + "\" + File1.List(i)
For j = 0 To File2.ListCount - 1
If File2.Selected(j) Then
Dim block As String
Dim insertPnt(0 To 2) As Double
insertPnt(0) = 5500
insertPnt(1) = -1500
insertPnt(2) = 0
block = File2.Path + "\" + File2.List(j)
Dim blockobj As AcadBlockReference
Set blockobj = AcadApp.ActiveDocument.ModelSpace.InsertBlock(insertPnt, block, 1, 1, 1, 0)
AcadApp.ActiveDocument.Save
AcadApp.ActiveDocument.Close
Close #1
End If
Next j
Close #1
End If
Next i
End Sub 展开
Dim i As Long
Dim j As Long
For i = 0 To File1.ListCount - 1
If File1.Selected(i) Then
AcadApp.Documents.Open File1.Path + "\" + File1.List(i)
For j = 0 To File2.ListCount - 1
If File2.Selected(j) Then
Dim block As String
Dim insertPnt(0 To 2) As Double
insertPnt(0) = 5500
insertPnt(1) = -1500
insertPnt(2) = 0
block = File2.Path + "\" + File2.List(j)
Dim blockobj As AcadBlockReference
Set blockobj = AcadApp.ActiveDocument.ModelSpace.InsertBlock(insertPnt, block, 1, 1, 1, 0)
AcadApp.ActiveDocument.Save
AcadApp.ActiveDocument.Close
Close #1
End If
Next j
Close #1
End If
Next i
End Sub 展开
2012-07-06
展开全部
我觉得您操作CAD应该学习、使用AutoLISP语言,因为各种编程语言各有所长、亦各有所短,应用领域差别挺大的。
(仅供参考)
(仅供参考)
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询