What's the diference between ObjectDBX & Getobject?

What's the diference between ObjectDBX & Getobject?

Anonymous
Not applicable
487 Views
10 Replies
Message 1 of 11

What's the diference between ObjectDBX & Getobject?

Anonymous
Not applicable
Hi

Do they do they have the same purpose?

Is there any good places for help on ObjectDBX? I can't find any.

Thanks in advance

Dave F.
0 Likes
488 Views
10 Replies
Replies (10)
Message 2 of 11

Anonymous
Not applicable
Dave F wrote:
> Hi
>
> Do they do they have the same purpose?

No. GetObject is a VB/A function that allows you to retrieve a running
instance of an ActiveX server. ObjectDBX is an API that allows you to
manipulate DWG content without first having to load that drawing into
the editor.

> Is there any good places for help on ObjectDBX? I can't find any.

Ask specific questions and you'll get plenty of good information from
the folks here.

--
There are 10 kinds of people. Those who understand binary and those who
don't.

http://code.acadx.com
(Pull the pin to reply)
0 Likes
Message 3 of 11

Anonymous
Not applicable
I'm confused.

Dim Xlobj As Excel.Workbook ' Variable to hold reference to Microsoft Excel.
Dim WrkSht As Excel.Worksheet

Set Xlobj = GetObject("c:\dwgs\fx15\fxstructsect.xls")
Set WrkSht = Xlobj.Sheets(ListBox1.ListIndex + 1)
etc...

In the above code I'm using Getobject to manipulate XLS content without
first having to load that drawing into the editor.
Which is what you say ObjectDBX does.
Can I use Getobject to manipulate a DWG in the same way?

Can you give a simple (I'm a bit slow on the uptake this morning :).)
explanation as to what an ActiveX server is?



"Frank Oquendo" wrote in message
news:16BF11F29878767919D9BB84695ABBCA@in.WebX.maYIadrTaRb...
> Dave F wrote:
> > Hi
> >
> > Do they do they have the same purpose?
>
> No. GetObject is a VB/A function that allows you to retrieve a running
> instance of an ActiveX server. ObjectDBX is an API that allows you to
> manipulate DWG content without first having to load that drawing into
> the editor.
>
> > Is there any good places for help on ObjectDBX? I can't find any.
>
> Ask specific questions and you'll get plenty of good information from
> the folks here.
>
> --
> There are 10 kinds of people. Those who understand binary and those who
> don't.
>
> http://code.acadx.com
> (Pull the pin to reply)
>
>
0 Likes
Message 4 of 11

Anonymous
Not applicable
> Set Xlobj = GetObject("c:\dwgs\fx15\fxstructsect.xls")
> In the above code I'm using Getobject to manipulate XLS content without
> first having to load that drawing into the editor.
"c:\dwgs\fx15\fxstructsect.xls" isn't a drawing, it's an excel spreadsheet

GetObject created, in this case, an instance of excel and then used that
instance to open the filename argument.

> Which is what you say ObjectDBX does.
with ObjectDbx you can create an instance of a drawing database which can
then be queried or edited via code, without having it open in the Acad
drawing editor.

> Can I use Getobject to manipulate a DWG in the same way?
you can use Getobject to get an instance of acad in the same way you use it
above to get an instance of excel, you will however be in the drawing editor
at that point.
With ObjectDbx you get an instance of the database without opening it in the
drawing editor.

in my limited understanding an ActiveX server is a program that follows
microsoft guidelines for making the programs objects and properties
available through ms functions such as GetObject etc. ie any program that
has vba available in it or which can respond to vb or vba
commands/functions.
and i stress "in my limited understanding" others can give a much more
correct and indepth definition.

hope that makes sense.
Mark

"Dave F" wrote in message
news:3A50D76950330361A9395B1CF6A3D203@in.WebX.maYIadrTaRb...
> I'm confused.
>
0 Likes
Message 5 of 11

Anonymous
Not applicable
"Mark Propst" wrote in message
news:1E5D811AD9B88DCC8CEDF9119BECAF32@in.WebX.maYIadrTaRb...
> > Set Xlobj = GetObject("c:\dwgs\fx15\fxstructsect.xls")
> > In the above code I'm using Getobject to manipulate XLS content without
> > first having to load that drawing into the editor.
> "c:\dwgs\fx15\fxstructsect.xls" isn't a drawing, it's an excel spreadsheet

I know, which is why I said XLS.

> GetObject created, in this case, an instance of excel and then used that
> instance to open the filename argument.

It didn't visibly display it on the screen. Is that what you mean by
'instance'?

> > Which is what you say ObjectDBX does.
> with ObjectDbx you can create an instance of a drawing database which can
> then be queried or edited via code, without having it open in the Acad
> drawing editor.

I'm not 100% sure, but I thought that was what GetObject does.
In my spreadsheet example it doesn't display in an excel window, it just
gives access to the database.
Is this correct?

If it isn't, my next question is:
Can I access the database of the .xls without opening it in an instance of
Excel?
The routine, as it stands is noticably slow accessing the .xls.

> > Can I use Getobject to manipulate a DWG in the same way?
> you can use Getobject to get an instance of acad in the same way you use
it
> above to get an instance of excel, you will however be in the drawing
editor
> at that point.
> With ObjectDbx you get an instance of the database without opening it in
the
> drawing editor.

So, using ObjectDBX is faster?

Thanks in advance for your help.

Dave F.
0 Likes
Message 6 of 11

Anonymous
Not applicable
Dave F wrote:

> If it isn't, my next question is:
> Can I access the database of the .xls without opening it in an
> instance of Excel?

No. ObjectDBX is for use only with DWG files. AFAIK, Microsoft has no
such technology for their Office documents.

--
There are 10 kinds of people. Those who understand binary and those who
don't.

http://code.acadx.com
(Pull the pin to reply)
0 Likes
Message 7 of 11

Anonymous
Not applicable
"Dave F" wrote ...
> I'm not 100% sure, but I thought that was what GetObject does.
> In my spreadsheet example it doesn't display in an excel window, it just
> gives access to the database.
> Is this correct?
>

I know Frank already answered this question, but I'll add that I think the
reason it's not displaying is that XL starts up with its .Visible property
set to False.

Xlobj.Visible = True
may cause the XL window to show (not that that's what your after, I know,
but just FYI)

If this doesn't make it show up, XL could just be opening and closing so
fast that it doesn't have time to show up on screen.

James
0 Likes
Message 8 of 11

Anonymous
Not applicable
Hi Dave,
now you got the big guns on your thread I'll back off - they're Waaaayyyyy
better than me at this stuff.
I'm just a fellow beginner who can sympathize with how hard some of this is
to understand when you're starting out.
You might want to do some general reading on Object oriented programming,
lots of resources out there that help with the basics.

"Dave F" wrote in message
news:53769E3B05D842B4395BE5E6A6493479@in.WebX.maYIadrTaRb...

> I know, which is why I said XLS.

I knew you knew that, but since you said.."first having to load that drawing
into the editor." i just threw that in for clarification.

> It didn't visibly display it on the screen. Is that what you mean by
> 'instance'?
James explained why it didn't display.

what i meant by "instance" goes back to the general background of object
oriented programming.
All objects are derived from classes(which in the context of vb would be in
a .cls file in your project.)
The .cls file contains the definition of the class, it's name, methods and
properties.
When you want to use a class(object) in your program, you create an instance
of the class.
That instance is assigned to the variable name you gave it, and then the
methods and properties are available to you through your variable name.

for example in acad you can
Dim oLine as AcadLine 'define the type of oLine variable as being of class
AcadLine
Set oLine = doc.AddLine blah blah 'create an instance of class AcadLine via
Autocad's interface
'now you can use the properties of that instance of that class
oLine.Layer = xxx

In the context of the GetObject function - as I understand it, that's a
special way to create an instance of a class which happens to be an
application object or a document object contained in an application object.

If the class type passed to GetObject function is an Application object, vb
will look for a running instance of that application class object and if it
exists in the running object table, it will return the first instance found
to your variable name and most likely cause it to become visible (depending
on other conditions in your codes). If it doesn't find a running instance,
it will return an error and you can trap that error, then use CreateObject
to creat a running instance (assuming that class is registered on your
machine etc).

If the class object type passed to GetObject is a document name, GetObject
will find the application associated with the extension of the filename, and
if it is registered, look for a running instance of that application and if
found, return it with the document opened in that instance of the
application class, or if not found, will create an instance of the
application and open the file in it. So that way is a shortcut to the first
way of trying to GetObject an app, trap the error, CreateObject, then open
the file.

I think that description (however inaccurate) applies generally to any
Activex application accessed through vb. ObjectDBX, on the other hand, is
specifically an AutoCAD interface, having nothing to do with excel or any
other application. And, since it's not an application object, rather an
interface, you don't create an instance of it with GetObject, instead you
use GetInterfaceObject.

Dim objdbx As AxDbDocument
Set objdbx = GetInterfaceObject("ObjectDBX.AxDbDocument")


>So, using ObjectDBX is faster?
yes, in general, since you can manipulate things without waiting for it to
come up in the editor, regens, etc. There are some things you can't do with
dbx though so it depends entirely on what you're trying to accomplish

hth
Mark
(if I botched the explanation of GetObject (which is entirely possible)
hopefully someone who actually knows what they're talking about will fix it)
0 Likes
Message 9 of 11

Anonymous
Not applicable
"Dave F" wrote in message

>
> If it isn't, my next question is:
> Can I access the database of the .xls without opening it in an instance of
> Excel?
> The routine, as it stands is noticably slow accessing the .xls.

For tabular data, Excel is both an ODBC and ADO data source,
but I can't say whether that's any faster than direct access
via Excel's object model.

For lower-level access to XLS worksheets, I can't say what's
available for ActiveX/VB(a), but there are plenty of third
party .XLS access tools available (read/write) for Delphi.

You should probably look around on the net, as given the
number of them avaialble for Delphi, there's almost certainly
something available for ActiveX/VB(A)

--
AcadXTabs: Document Tabs for AutoCAD
http://www.acadxtabs.com
0 Likes
Message 10 of 11

Anonymous
Not applicable
In article <53769E3B05D842B4395BE5E6A6493479@in.WebX.maYIadrTaRb>, Dave F
wrote:
> "Mark Propst" wrote in message
> news:1E5D811AD9B88DCC8CEDF9119BECAF32@in.WebX.maYIadrTaRb...
> Can I access the database of the .xls without opening it in an instance of
> Excel?

Yes, although there are limitations; the most noticeable one is that you can't
delete a row. See
<>.

--
jrf
Member of the Autodesk Discussion Forum Moderator Program
Please do not email questions unless you wish to hire my services
0 Likes
Message 11 of 11

Anonymous
Not applicable
In article , Frank
Oquendo wrote:
> Dave F wrote:
>
> > If it isn't, my next question is:
> > Can I access the database of the .xls without opening it in an
> > instance of Excel?
>
> No. ObjectDBX is for use only with DWG files. AFAIK, Microsoft has no
> such technology for their Office documents.

Er, Microsoft does not have ObjectDBX-like technology ... but you can
access an Excel spreadsheet without opening it in Excel.

--
jrf
Member of the Autodesk Discussion Forum Moderator Program
Please do not email questions unless you wish to hire my services
0 Likes