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

Connect to a FDO via Plugin

7 REPLIES 7
SOLVED
Reply
Message 1 of 8
Anonymous
1433 Views, 7 Replies

Connect to a FDO via Plugin

Hello,

 

I am developing a plugin in which the user logs on to a Oracle server.

When the login is accepted I would like to create and connect a FDO to the same database.

 

Is there a way to create a FDO connection via a VB.Net plugin?

 

/ Per

7 REPLIES 7
Message 2 of 8
norman.yuan
in reply to: Anonymous

When you say "plug-in", hopefully you mean DLL developed with AutoCAD .NET API. Yes, you can connect to FDO source, as long as the FDO provider is available in the computer. There are 2 ways to do that:

 

1. AutoCAD Map (since 2008/9) comes with "platform API" (or geospatial API) that deals with FDO (and more).

 

If you download AutoCAD Map ObjectARX SDK, you can find the API's documentation and sample code on how to connect AutoCAD with FDO data source and get FDO goemetries/data into AutoCAD Map.

 

You can also go to Autodesk's Infrastructure Modeling DevBlog and searcg for "FDO", which would bring you a few articles on this topic.

 

2. You can also bypass AutoCAD Map's platform API and directly use FDO API (AutoCAD installation get all FDO components installed).

 

In most cases, you'll go with 1.

Norman Yuan

Drive CAD With Code

EESignature

Message 3 of 8
Alfred.NESWADBA
in reply to: Anonymous

Hi,

 

let me add some info's to Norman's suggestions:

 

You can download the ObjectARX kit for Map3D >>>there<<<

Within that you have samples that show's how to connect to source data (FDO) using API like the sample "Map Samples\Platform\BuildMap"

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2024
------------------------------------------------------------------------------------

(not an Autodesk consultant)
Message 4 of 8
Anonymous
in reply to: norman.yuan

I found a solution.

 

This is what I did.

 

Dim connManager As OSGeo.FDO.IConnectionManager = OSGeo.FDO.ClientServices.FeatureAccessManager.GetConnectionManager()
Dim conn As OSGeo.FDO.Connections.IConnection = connManager.CreateConnection("Autodesk.Oracle.3.9")
conn.ConnectionString = "Service=SRID;Username=USERNAME;Password=PASSWORD;Datastore=SCHEMA"
conn.Open()

.....

conn.Close()

 

Hope this helps someone!

 

// Per

Message 5 of 8
Alfred.NESWADBA
in reply to: Anonymous

Hi,

 

thx for your feedback and for showing your code, great!

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2024
------------------------------------------------------------------------------------

(not an Autodesk consultant)
Message 6 of 8
fieldguy
in reply to: Anonymous

What reference is required for OSGeo.FDO.IConnectionManager?

Message 7 of 8
norman.yuan
in reply to: fieldguy

It is in assembly OSGeo.FDO.dll, which you can find with AutoCAD Map/Civil's installation location:

C:\...[AutoCAD201x]\Map\bin

 

To directly use FDO, you usually add references to:

 

OSGeo.FDO.dll

OSGeo.FDO.Common.dll

OSGeo.FDO.Geometry.dll

Norman Yuan

Drive CAD With Code

EESignature

Message 8 of 8
fieldguy
in reply to: norman.yuan

Perfect - thank you! 

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

Post to forums  

Autodesk Design & Make Report