Okay, here's the VBA code:
Public Function DwgToDwg(objTarget As AcadDocument) As Variant
Dim objSelSet As AcadSelectionSet
Dim objOrgEnts() As Object
Dim destEnts As Variant
Dim intCnt As Long
On Error GoTo Error_Control
Set objSelSet = ThisDrawing.SelectionSets.Add("copyobjs")
objSelSet.SelectOnScreen
'Now reset the size of the array to the selection sets
'count minus one (arrays are zero-based)
ReDim objOrgEnts(objSelSet.Count - 1)
'Add each of the selected objects into the array
For intCnt = 0 To objSelSet.Count - 1
Set objOrgEnts(intCnt) = objSelSet(intCnt)
Next
'Copy all of the objects into the target drawings' model space.
DwgToDwg = ThisDrawing.CopyObjects(objOrgEnts, objTarget.ModelSpace)
Exit_Here:
objSelSet.Delete
Exit Function
Error_Control:
MsgBox Err.Description, vbOKOnly, Err.Number
End Function
Public Sub TestCopy()
Dim varObjs As Variant
Dim intCnt As Integer
On Error GoTo Err_Control
'Make sure that the index of the target drawing is correct for your project!
varObjs = DwgToDwg(Application.Documents(1))
Application.ActiveDocument = Application.Documents(1)
For intCnt = LBound(varObjs) To UBound(varObjs)
'Ghost the new objects.
varObjs(intCnt).Highlight True
Next intCnt
Exit_Here:
Exit Sub
Err_Control:
MsgBox Err.Description
End Sub
Some of the things I'm missing are how to start AutoCad up from VB, how to load drawings in VB (into AutoCad), and the syntax used to refer to the different drawings in VB.