Тема: Вставка XRef

Господа, как на бэсике вставить xref в чертеж? мне известен путь, причем пользователь должен указать точку вставки и задать угол поворота.

Re: Вставка XRef

Sub Example_AttachExternalReference()
    ' This example displays all the blocks in the current drawing
    ' before and after adding an external reference.
    '
    ' This example uses the "downtown.dwg" found in the sample
    ' directory. If you do not have this image, or it is located
    ' in a different directory, insert a valid path and filename
    ' for the PathName variable below.
    Dim InsertPoint(0 To 2) As Double
    Dim insertedBlock As AcadExternalReference
    Dim tempBlock As AcadBlock
    Dim msg As String, PathName As String
    ' Define external reference to be inserted
    InsertPoint(0) = 1: InsertPoint(1) = 1: InsertPoint(2) = 0
    PathName = "c:\program files\autocad 2000i\sample\downtown.dwg"
    ' Display current Block information for this drawing
    GoSub ListBlocks
    ' Add the external reference to the drawing
    Set insertedBlock = ThisDrawing.ModelSpace.AttachExternalReference(PathName, "XREF_IMAGE", InsertPoint, 1, 1, 1, 0, False)
    ThisDrawing.Application.ZoomAll
    ' Display new Block information for this drawing
    GoSub ListBlocks
    Exit Sub
ListBlocks:
    msg = vbCrLf    ' Reset message
    For Each tempBlock In ThisDrawing.Blocks
        msg = msg & tempBlock.name & vbCrLf     ' Add Block to list
    Next
    MsgBox "The current blocks in this drawing are: " & msg
    Return
End Sub