明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1366|回复: 0

块参照问题

[复制链接]
发表于 2004-8-3 22:15:00 | 显示全部楼层 |阅读模式
Sub Example_Bind()
On Error GoTo ERRORHANDLER

' Define external reference to be inserted
Dim xrefHome As AcadBlock
Dim xrefInserted1 As AcadExternalReference
Dim xrefInserted2 As AcadExternalReference

Dim insertionPnt(0 To 2) As Double
Dim PathName As String

insertionPnt(0) = 1
insertionPnt(1) = 1
insertionPnt(2) = 0
PathName = "e:/lgs/ER1.dwg"

' Add the external reference
Set xrefInserted1 = ThisDrawing.ModelSpace. _
AttachExternalReference(PathName, "XREF_IMAGE", _
insertionPnt, 1, 1, 1, 90, False)

Set xrefInserted2 = ThisDrawing.ModelSpace. _
AttachExternalReference(PathName, "XREF_IMAGE", _
insertionPnt, 1, 1, 1, 0, False)
ZoomAll
MsgBox "The external reference is attached."

' Bind the external reference definition
ThisDrawing.Blocks.Item(xrefInserted1.Name).Bind False
'ThisDrawing.Blocks.Item(xrefInserted2.Name).Bind False
MsgBox "The external reference is bound."

Exit Sub
ERRORHANDLER:
MsgBox Err.Description
End Sub 为什么不要ThisDrawing.Blocks.Item(xrefInserted1.Name).Bind False就可以在一个CAD窗口多次运行程序? 但采用ThisDrawing.Blocks.Item(xrefInserted1.Name).Bind False却不能在同一个CAD窗口多次运行程序,是不是该CAD图块文件被独占打开,而没有关闭。有什么办法不去掉该语句并能解决这个问题吗? 先谢谢大侠!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-11-28 02:39 , Processed in 0.151083 second(s), 24 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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