ObjectDBX question

ObjectDBX question

Anonymous
Not applicable
316 Views
6 Replies
Message 1 of 7

ObjectDBX question

Anonymous
Not applicable
i'm using dbx with standalone vb.  i don't
know where to begin so can someone help me on just opening a file (C:\Test.dwg)
and displaying a msgbox with how many blocks are in the drawing.  do i need
an autocad.acadapplication first or do i make a new dbx document only or
what?  i'm looking for speed here and using the acad object to open
drawings is too slow.

 

please help, thanks

Rob
--
W2k,
A2K2, VB6, VB.NET
0 Likes
317 Views
6 Replies
Replies (6)
Message 2 of 7

Anonymous
Not applicable
From Standalone VB, AutoCAD needs to be running, and you
must use the AcadApplication's GetInterfaceObject() method
to create the AxDbDocument instance:

Dim oAcad As AcadApplication
Dom dbxDoc As AxDbDocument

oAcad = GetObject(, "AutoCAD.Application.15")

dbxDoc = oAcad.GetInterfaceObject("ObjectDBX.AxDbDocument")

MsgBox " Block count = " & dbxDoc.Blocks.Count


"Rob Tomson" wrote in message
news:AA178EAF6B388A9F1B08A70BAF1BCB64@in.WebX.maYIadrTaRb...
> i'm using dbx with standalone vb. i don't know where to begin so can
someone help me on just opening a file (C:\Test.dwg) and displaying a msgbox
with how many blocks are in the drawing. do i need an
autocad.acadapplication first or do i make a new dbx document only or what?
i'm looking for speed here and using the acad object to open drawings is too
slow.
>
> please help, thanks
> Rob
> --
> W2k, A2K2, VB6, VB.NET
>
0 Likes
Message 3 of 7

Anonymous
Not applicable
I just finished going through what your trying to
do.  I started and finished a vb6.exe using objectDBX then I rewrote it to
use AcadX instead of objectDXB and greatly increased my speed.

 

Go here for more info or email me directly for
questions

 



style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">

i'm using dbx with standalone vb.  i don't
know where to begin so can someone help me on just opening a file
(C:\Test.dwg) and displaying a msgbox with how many blocks are in the
drawing.  do i need an autocad.acadapplication first or do i make a new
dbx document only or what?  i'm looking for speed here and using the
acad object to open drawings is too slow.

 

please help, thanks

Rob
--
W2k,
A2K2, VB6, VB.NET
0 Likes
Message 4 of 7

Anonymous
Not applicable
that's what i needed to know, thank you very much!

Rob
--
W2k, A2K2, VB6, VB.NET
"Tony Tanzillo" wrote in message
news:6CF7BFF63F1354CA3B9D2DFBC3832A30@in.WebX.maYIadrTaRb...
> From Standalone VB, AutoCAD needs to be running, and you
> must use the AcadApplication's GetInterfaceObject() method
> to create the AxDbDocument instance:
>
> Dim oAcad As AcadApplication
> Dom dbxDoc As AxDbDocument
>
> oAcad = GetObject(, "AutoCAD.Application.15")
>
> dbxDoc = oAcad.GetInterfaceObject("ObjectDBX.AxDbDocument")
>
> MsgBox " Block count = " & dbxDoc.Blocks.Count
>
>
> "Rob Tomson" wrote in message
> news:AA178EAF6B388A9F1B08A70BAF1BCB64@in.WebX.maYIadrTaRb...
> > i'm using dbx with standalone vb. i don't know where to begin so can
> someone help me on just opening a file (C:\Test.dwg) and displaying a
msgbox
> with how many blocks are in the drawing. do i need an
> autocad.acadapplication first or do i make a new dbx document only or
what?
> i'm looking for speed here and using the acad object to open drawings is
too
> slow.
> >
> > please help, thanks
> > Rob
> > --
> > W2k, A2K2, VB6, VB.NET
> >
>
>
0 Likes
Message 5 of 7

Anonymous
Not applicable
will this code still work in VB.net ?

--
W2k, A2K2, VB6, VB.NET
"Tony Tanzillo" wrote in message
news:6CF7BFF63F1354CA3B9D2DFBC3832A30@in.WebX.maYIadrTaRb...
> From Standalone VB, AutoCAD needs to be running, and you
> must use the AcadApplication's GetInterfaceObject() method
> to create the AxDbDocument instance:
>
> Dim oAcad As AcadApplication
> Dom dbxDoc As AxDbDocument
>
> oAcad = GetObject(, "AutoCAD.Application.15")
>
> dbxDoc = oAcad.GetInterfaceObject("ObjectDBX.AxDbDocument")
>
> MsgBox " Block count = " & dbxDoc.Blocks.Count
>
>
> "Rob Tomson" wrote in message
> news:AA178EAF6B388A9F1B08A70BAF1BCB64@in.WebX.maYIadrTaRb...
> > i'm using dbx with standalone vb. i don't know where to begin so can
> someone help me on just opening a file (C:\Test.dwg) and displaying a
msgbox
> with how many blocks are in the drawing. do i need an
> autocad.acadapplication first or do i make a new dbx document only or
what?
> i'm looking for speed here and using the acad object to open drawings is
too
> slow.
> >
> > please help, thanks
> > Rob
> > --
> > W2k, A2K2, VB6, VB.NET
> >
>
>
0 Likes
Message 6 of 7

Anonymous
Not applicable
I don't see why not.

"Rob Tomson" wrote in message
news:4B8B88935EE4CDF18E701ACE975DD779@in.WebX.maYIadrTaRb...
> will this code still work in VB.net ?
>
> --
0 Likes
Message 7 of 7

Anonymous
Not applicable
because i get the following error:

'************
An unhandled exception of type 'System.Runtime.InteropServices.COMException'
occurred in AutoCAD Test.exe

Additional information: Problem in loading application
'************

the error occurs on the line:
dbxDoc = oAcad.GetInterfaceObject("ObjectDBX.AxDbDocument")

what can i do to fix this?

thanks for your help,
Rob
--
W2k, A2K2, VB6, VB.NET
"Tony Tanzillo" wrote in message
news:264652F47446D49408384E78C7D39AA1@in.WebX.maYIadrTaRb...
> I don't see why not.
>
> "Rob Tomson" wrote in message
> news:4B8B88935EE4CDF18E701ACE975DD779@in.WebX.maYIadrTaRb...
> > will this code still work in VB.net ?
> >
> > --
>
>
>
>
>
0 Likes