Community
Civil 3D Customization
Welcome to Autodesk’s AutoCAD Civil 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Civil 3D Customization topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

ObjectDBX

20 REPLIES 20
Reply
Message 1 of 21
Anonymous
1558 Views, 20 Replies

ObjectDBX

Can ObjectDBX be used to extract Civil 3d information
from a drawing?
20 REPLIES 20
Message 2 of 21
Anonymous
in reply to: Anonymous


No, the Civil 3D objects are exposed with COM and
moving forward with .NET.

 

Regards,

 

Peter Funk

Civil 3D Product Manager

Autodesk, Inc.
Message 3 of 21
jpkycek
in reply to: Anonymous

Hi Peter,

I understand that. But what I am getting at is, once the drawing is opened with
ObjectDBX, then it should be possible to access the open drawing using:

Set acad = GetObject(, "AutoCAD.Application.17") (for civil3d 2008).

This works, and I can, obtain, the acad.aplication from the drawing opened with
objectdbx this way, but so far not the correct instance of the drawing that is being
examined by objectdbx. Once I find out how to access the correct dwg instance
being examined by objectdbx, then it should be possible to use:

Set MyApp = acad.GetInterfaceObject("AeccXUiLand.AeccApplication.5.0")

(for civil3d 2008) as normal, to load the civil3d land object: to list civil3d styles,
alignments etc from the drawing.

I have a vb app that I wrote a couple years back that uses objectdbx to list layers,
blocks, and linetypes from drawings, and I was hoping to expand the app to list
civil3d data too.

Any help appreciated,

thanks,

Joe Kycek
Message 4 of 21
Anonymous
in reply to: Anonymous


Hi Joe,

ObjectDBX, at least the version included in Acad, runs inside
of Autocad and does not have a separate AcadApplication. Therefor the line
"Set acad = GetObject(, "AutoCAD.Application.17")" is
obtaining the first found Acadapplication, which will normally be the same
object your current drawing is loaded in. You can verify this in the VBAIDE
using the locals window. First, note the value of the ODBX's Application
property. Then note the Name property of the acad object you obtained with
GetObject, this will be the name of your actual current drawing.

 

 


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Hi
Peter, I understand that. But what I am getting at is, once the drawing is
opened with ObjectDBX, then it should be possible to access the open drawing
using: Set acad = GetObject(, "AutoCAD.Application.17") (for civil3d 2008).
This works, and I can, obtain, the acad.aplication from the drawing opened
with objectdbx this way, but so far not the correct instance of the drawing
that is being examined by objectdbx. Once I find out how to access the correct
dwg instance being examined by objectdbx, then it should be possible to use:
Set MyApp = acad.GetInterfaceObject("AeccXUiLand.AeccApplication.5.0") (for
civil3d 2008) as normal, to load the civil3d land object: to list civil3d
styles, alignments etc from the drawing. I have a vb app that I wrote a couple
years back that uses objectdbx to list layers, blocks, and linetypes from
drawings, and I was hoping to expand the app to list civil3d data too. Any
help appreciated, thanks, Joe Kycek
Message 5 of 21
Anonymous
in reply to: Anonymous


Joe,

 

I would look at using .NET to do this instead of
ObjectARX. Each release we expose more of the Civil 3D objects to .NET and
continue to do so, and working with the AutoCAD elements like layers with .NET
is very straight forward.

 

Regards,

 

Peter Funk

Autodesk, Inc.
Message 6 of 21
Anonymous
in reply to: Anonymous

Peter Funk - Autodesk wrote:

> I would look at using .NET to do this instead of ObjectARX. Each release we
> expose more of the Civil 3D objects to .NET and continue to do so, and working
> with the AutoCAD elements like layers with .NET is very straight forward.

Can you comment on the status of Point, Parcels and Surfaces .NET
interfaces?

Terry
Message 7 of 21
Anonymous
in reply to: Anonymous

The "ObjectDBX" Joe is referring to is the ObjectDBX ActiveX layer
(AxDbDocument), not the native C++ API.

There should be no problem accessing Civil3D objects via ObjectDBX ActiveX.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2009
Supporting AutoCAD 2000 through 2009

http://www.acadxtabs.com

Introducing AcadXTabs 2010:
http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm


; "Inc." wrote in message
news:6124352@discussion.autodesk.com...
No, the Civil 3D objects are exposed with COM and moving forward with .NET.

Regards,

Peter Funk
Civil 3D Product Manager
Autodesk, Inc.
Message 8 of 21
Anonymous
in reply to: Anonymous

Ok, Tony, how about a wee bit of help on HOW one would do this?

Using this little sample, perhaps.

Sub test()
Dim dbxDoc As AxDbDocument
Dim aeccApp As AeccApplication
Dim aeccDoc As AeccDocument

Set dbxDoc = Application.GetInterfaceObject("ObjectDBX.AxDbDocument.17")
dbxDoc.Open "C:\Civil 3D Projects2009\Intersect.dwg"

Set aeccApp =
Application.GetInterfaceObject("AeccXUiLand.AeccApplication.6.0")
''Set aeccDoc = dbxDoc ''obviously does not work

Set aeccDoc = aeccApp.ActiveDocument
Dim strStyleSet1 As String
''this next line is ok
strStyleSet1 =
aeccDoc.Settings.AlignmentCommandsSettings.AddAlignOffLblSettings.StyleSettings.LabelStyleSet.Value
Dim strStyleSet2 As String
''this next line fails, as I would expect it to
strStyleSet2 =
dbxDoc.Settings.Settings.AlignmentCommandsSettings.AddAlignOffLblSettings.StyleSettings.LabelStyleSet.Value

End Sub

Thanks!
Jeff

"Tony Tanzillo" wrote in message
news:6131240@discussion.autodesk.com...
The "ObjectDBX" Joe is referring to is the ObjectDBX ActiveX layer
(AxDbDocument), not the native C++ API.

There should be no problem accessing Civil3D objects via ObjectDBX ActiveX.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2009
Supporting AutoCAD 2000 through 2009

http://www.acadxtabs.com

Introducing AcadXTabs 2010:
http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm


; "Inc." wrote in message
news:6124352@discussion.autodesk.com...
No, the Civil 3D objects are exposed with COM and moving forward with .NET.

Regards,

Peter Funk
Civil 3D Product Manager
Autodesk, Inc.
Message 9 of 21
Anonymous
in reply to: Anonymous

Jeff - I don't think you can access outboard databases as
AeccDocuments, because that interface is dependent
on AcadDocument, which is not related to AxDbDocument.

IOW, to get a valid AeccDocument, you must have an
AcadDocument wrapping the database.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2009
Supporting AutoCAD 2000 through 2009

http://www.acadxtabs.com

Introducing AcadXTabs 2010:
http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm


"Jeff Mishler" wrote in message
news:6131360@discussion.autodesk.com...
Ok, Tony, how about a wee bit of help on HOW one would do this?

Using this little sample, perhaps.

Sub test()
Dim dbxDoc As AxDbDocument
Dim aeccApp As AeccApplication
Dim aeccDoc As AeccDocument

Set dbxDoc = Application.GetInterfaceObject("ObjectDBX.AxDbDocument.17")
dbxDoc.Open "C:\Civil 3D Projects2009\Intersect.dwg"

Set aeccApp =
Application.GetInterfaceObject("AeccXUiLand.AeccApplication.6.0")
''Set aeccDoc = dbxDoc ''obviously does not work

Set aeccDoc = aeccApp.ActiveDocument
Dim strStyleSet1 As String
''this next line is ok
strStyleSet1 =
aeccDoc.Settings.AlignmentCommandsSettings.AddAlignOffLblSettings.StyleSettings.LabelStyleSet.Value
Dim strStyleSet2 As String
''this next line fails, as I would expect it to
strStyleSet2 =
dbxDoc.Settings.Settings.AlignmentCommandsSettings.AddAlignOffLblSettings.StyleSettings.LabelStyleSet.Value

End Sub

Thanks!
Jeff

"Tony Tanzillo" wrote in message
news:6131240@discussion.autodesk.com...
The "ObjectDBX" Joe is referring to is the ObjectDBX ActiveX layer
(AxDbDocument), not the native C++ API.

There should be no problem accessing Civil3D objects via ObjectDBX ActiveX.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2009
Supporting AutoCAD 2000 through 2009

http://www.acadxtabs.com

Introducing AcadXTabs 2010:
http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm


; "Inc." wrote in message
news:6124352@discussion.autodesk.com...
No, the Civil 3D objects are exposed with COM and moving forward with .NET.

Regards,

Peter Funk
Civil 3D Product Manager
Autodesk, Inc.
Message 10 of 21
Anonymous
in reply to: Anonymous

Thanks, Tony. That was pretty much what I had determined but I was hoping
you knew of some way around it.


"Tony Tanzillo" wrote in message
news:6138908@discussion.autodesk.com...
Jeff - I don't think you can access outboard databases as
AeccDocuments, because that interface is dependent
on AcadDocument, which is not related to AxDbDocument.

IOW, to get a valid AeccDocument, you must have an
AcadDocument wrapping the database.

--
http://www.caddzone.com
Message 11 of 21
Anonymous
in reply to: Anonymous

BTW, what happens when you get a Civil3D custom
object through an AxDbDocument, with the Civil3D
COM libraries loaded?

Do you get the Civil3D COM wrapper, or just an AcadObject?

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2009
Supporting AutoCAD 2000 through 2009

http://www.acadxtabs.com

Introducing AcadXTabs 2010:
http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm


"Jeff Mishler" wrote in message
news:6138941@discussion.autodesk.com...
Thanks, Tony. That was pretty much what I had determined but I was hoping
you knew of some way around it.


"Tony Tanzillo" wrote in message
news:6138908@discussion.autodesk.com...
Jeff - I don't think you can access outboard databases as
AeccDocuments, because that interface is dependent
on AcadDocument, which is not related to AxDbDocument.

IOW, to get a valid AeccDocument, you must have an
AcadDocument wrapping the database.

--
http://www.caddzone.com
Message 12 of 21
Anonymous
in reply to: Anonymous

I get the COM object! So, this is a start. Now to find how to access the
non-graphical objects, i.e. the Settings.


"Tony Tanzillo" wrote in message
news:6138942@discussion.autodesk.com...
BTW, what happens when you get a Civil3D custom
object through an AxDbDocument, with the Civil3D
COM libraries loaded?

Do you get the Civil3D COM wrapper, or just an AcadObject?

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2009
Supporting AutoCAD 2000 through 2009

http://www.acadxtabs.com

Introducing AcadXTabs 2010:
http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm


"Jeff Mishler" wrote in message
news:6138941@discussion.autodesk.com...
Thanks, Tony. That was pretty much what I had determined but I was hoping
you knew of some way around it.


"Tony Tanzillo" wrote in message
news:6138908@discussion.autodesk.com...
Jeff - I don't think you can access outboard databases as
AeccDocuments, because that interface is dependent
on AcadDocument, which is not related to AxDbDocument.

IOW, to get a valid AeccDocument, you must have an
AcadDocument wrapping the database.

--
http://www.caddzone.com
Message 13 of 21
Anonymous
in reply to: Anonymous

Jeff,

You can use the COM objects in C++ if you really want, but I would recommend
working with C# instead. That will give you access to the COM as well as the
.NET assemblies where most of our new API development is focused. If you
haven't already, be sure to get the Beta for the next release and take a
look at the new API.

Cheers,

Peter Funk
Autodesk, Inc.
Message 14 of 21
jpkycek
in reply to: Anonymous

Hi Peter,

Would you explain the difference in:

COM objects in C++
COM objects in C#

As Autodesk sees it?
Message 15 of 21
jpkycek
in reply to: Anonymous

Hi Peter,

Would you explain the difference in:

COM objects in C++
COM objects in C#

As Autodesk sees it?
Message 16 of 21
Anonymous
in reply to: Anonymous


I find dealing with COM object in C# eaiser to use
than in C++ because C# does a better job with the memory management (cleaning up
after you) than does C++. If you are going to use C++, be sure to use smart
pointers.

 

I also find the syntax and tool set of C# more
to my liking than C++.

 

Finally, as we migrate more of the Civil 3D
API to native .NET, working in C# now will give you a leg up.

 

Cheers,

 

Peter Funk

Civil 3D Product Manager

Autodesk, Inc.
Message 17 of 21
jpkycek
in reply to: Anonymous

Yes, it is possible, and it works.

My original question was:

>
"Can ObjectDBX
be used to extract Civil 3d information
from a drawing?"
<

Peter Funk said NO. This is Not true!

Funk: Re-read the initial question!

Funks wrong answer led me down the wrong path for
a few months.

But I found:
I can extract Civil3d Alignment, Profile, ProfileView objects etc...
from a closed drawing using objectDbx and then transfer the
information into another open drawing using VBA.

Peter Flunk: Your wrong...
You should research before giving an answer like "NO".


JK
Message 18 of 21
Anonymous
in reply to: Anonymous

Are you getting the DATA from the objects in the ODBX document, or are you
copying the OBJECTS to a new DWG that you are then getting the data from? It
sounds like the latter option, in which case Peter is still correct, you
cannot gat the DATA(information) through ObjectDBX. You might be able to do
it through workarounds, but copying the objects to another drawing....what's
the point? Just open the original and get the desired data from there.

BTW, when finding an answer to a posted question, newsgroup etiquette says
you should post that solution for others to see. Just a thought.


"jpkycek" wrote in message news:6237814@discussion.autodesk.com...
> Yes, it is possible, and it works.
>
> My original question was:
>
> >
> "Can ObjectDBX
> be used to extract Civil 3d information
> from a drawing?"
> <
>
> Peter Funk said NO. This is Not true!
>
> Funk: Re-read the initial question!
>
> Funks wrong answer led me down the wrong path for
> a few months.
>
> But I found:
> I can extract Civil3d Alignment, Profile, ProfileView objects etc...
> from a closed drawing using objectDbx and then transfer the
> information into another open drawing using VBA.
>
> Peter Flunk: Your wrong...
> You should research before giving an answer like "NO".
>
>
> JK
Message 19 of 21
jpkycek
in reply to: Anonymous

I am getting the data from the objects in the ODBX document.
And neither copying the objects to a new dwg. No workarounds.
I Collect what I need from the ODBX document, close it, and use the
data/objects where needed. Everyone knows ObjectDBX
is faster in getting data vs. opening drawings. If the target
drawing is closed I use ObjectDBX to get the data, else
if the drawing is open i just get the data from the open dwg.

My initial question was just about getting simple data.
Funk confused the question with corporate spin as he
does, promoting .Net. rather than help. I can write
in .Net, but this project is in vb/vba.

BTW, I usually post solutions. And probably will.

JK
Message 20 of 21
jpkycek
in reply to: Anonymous

Jeff Mishler,

Have you figured it out yet?

My original question was:

"Can ObjectDBX
be used to extract Civil 3d information
from a drawing?"

I said Yes!,
Peter Funk said No!,

I did not mention the type
of data or objects from
the ObjectDBX drawing or the
method on how to get it
because it is part of the Answer.

What do you think the Answer whould be?
Look outside the box.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


Autodesk Design & Make Report