Okay CAD Gurus... I'm looking to you for a little
help with this problem. I've recently started to mess around with
ObjectDBX and I've run into a wall. I'm trying to attach an external
reference into a drawing and then save it, but.... It seems to only attach
the file to the drawing that I currently have open and not the one that I
specify in the code.
Here's my code.
Public Sub testDXB()
Dim
DbxDoc As AxDbDocument
Dim varPnt As
Variant
Dim dblX As Double
Dim
dblAngle As Double
Dim objUtil As Object
dblAngle = CDbl(0 / 180 *
(Atn(1) * 4))
Set objUtil =
ThisDrawing.Utility
objUtil.CreateTypedArray varPnt,
vbDouble, 0#, 0#, 0#
dblX = CDbl(1#)
Set DbxDoc =
ThisDrawing.Application.GetInterfaceObject("ObjectDBX.AxDbDocument.16")
face=Tahoma size=2>
DbxDoc.Open
"e:\work\drawing1.dwg"
DbxDoc.ModelSpace.AttachExternalReference "e:\work\drawing2.dwg", "DRAWING2",
varPnt, dblX, dblX, dblX, dblAngle, True
DbxDoc.SaveAs
"e:\work\DRAWING3.dwg"
Set DbxDoc = Nothing
End Sub
--
Matt W
There are 3 kinds of people:
Those
who can count, and those who can't.