- 积分
- 987
- 明经币
- 个
- 注册时间
- 2004-2-13
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
楼主 |
发表于 2004-7-13 10:31: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
重新运行会发现存在"File Access error"的错误,请大侠帮我看看,应该怎样消除这个问题
此外,怎样获得已经插入到图形中的块的插入点,xScale,yScale,zScale等参数
谢谢! |
|