在我看来,从日常生活中,我应该能够做到:
-
- Dim xrfilename As String
- Dim blkname As String
- xrfilename = "" ' clean up previous
- Dim p, f, s
- p = ThisDrawing.GetVariable("DWGPREFIX")
- f = "AutoCAD Drawings and Templates|*.dwg;*.dwt|All Files|*.*|"
- xrfilename = BrowseForFile(p, f)
- blkname = "XREF_IMAGE" '"" 'InputBox(vbCr & vbCr & "Enter block name for XRef: ", "XRef Image Name")
并添加一个简单的IF语句,例如:
-
- [b]If xrfilename = "" Then[/b]
- Dim xrfilename As String
- Dim blkname As String
- xrfilename = "" ' clean up previous
- Dim p, f, s
- p = ThisDrawing.GetVariable("DWGPREFIX")
- f = "AutoCAD Drawings and Templates|*.dwg;*.dwt|All Files|*.*|"
- xrfilename = BrowseForFile(p, f)
- blkname = "XREF_IMAGE" '"" 'InputBox(vbCr & vbCr & "Enter block name for XRef: ", "XRef Image Name")
- [b]End If[/b]
但由于某些原因,xrfilename没有保留原始路径和图形,因此当它第二次通过循环时,仍会提示我协商外部参照的路径。我错过了什么?
(这块板需要一个男人拔头发的表情符号) |