外部参照的问题???
各位大侠,大家好,我有一个问题问大家???我想插入一个外部参照的块,并给他附上属性,可是一直不成功,why?Public Sub arrester()
Dim attheight As Double
Dim attmode As Long
Dim attprompt(0 To 20) As String
Dim attinspoint(0 To 2) As Double
Dim atttag(0 To 20) As String
Dim attvalue(0 To 20) As String
Dim inputpoint(0 To 2) As Double
Dim blockname As String
Dim i As Integer
Public externalblock As AcadExternalReference
Public attriobject As AcadAttribute
Public blockrefobj As AcadBlockReference
inputpoint(0) = 2
inputpoint(1) = 2
inputpoint(2) = 2
filename = "D:\Program files\ACAD2000\firstside\arrester.dwg" '图块的位置
blockname = "arrester"
attheight = 1
atttmode = acAttributeModeVerify
attinspoint(0) = 10
attinspoint(1) = 10
attinspoint(2) = 0
atttag(0) = "model"
atttag(1) = "modelID"
attprompt(0) = "model"
attprompt(1) = "modelID"
attvalue(0) = "arrester"
attvalue(1) = "111"
For i = 0 To 1
Set attriobject = externalblock.AddAttribute(attheight, attmode, attprompt(i), attinspoint, atttag(i), attvalue(i))
attriobject.Invisible = True
Next i
Set externalblock = ThisDrawing.ModelSpace.AttachExternalReference(filename, blockname, inputpoint, 1, 1, 1, 0, False)
End Sub
帮帮忙?why?谢谢
页:
[1]