明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1813|回复: 0

外部参照的问题???

[复制链接]
发表于 2002-9-16 11:37:00 | 显示全部楼层 |阅读模式
各位大侠,大家好,我有一个问题问大家???我想插入一个外部参照的块,并给他附上属性,可是一直不成功,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?谢谢
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-11-28 20:58 , Processed in 0.168657 second(s), 24 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表