AttachExternalReference method example

Private Sub AddXRef_Example()

' This example adds an external reference using the MAP.DWG file

' found in the Samples folder. You may need to change the path and

' filename for your system.

     

     Dim insPt As IntelliCAD.Point

     Dim insertedXRef As IntelliCAD.ExternalReference

     Dim msg As String, PathName As String, XrefName As String

     XrefName = InputBox("Type an XRef name")

     Set insPt = Library.CreatePoint(1, 1, 0)

     PathName = "c:\program files\IntelliCAD2001\Samples\map.dwg"

     ' Add the external reference to the drawing

     Set insertedXRef = ThisDocument.ModelSpace.AttachExternalReference(PathName, XrefName, insPt, 1, 1, 1, 0, False)

     MsgBox "The external reference '" & XrefName & "' is attached."

End Sub