GeoMedia Discussions

Search for an answer, post a question, or answer other users' questions in our GeoMedia support discussions. This discussion board is a great way to collaborate with industry peers around the world. It is intended for discussion and support of the GeoMedia Desktop and Add-on applications.
Showing results for 
Search instead for 
Do you mean 
Occasional Contributor
Posts: 5
Registered: ‎12-20-2017
Accepted Solution

Create a Cadserver in GeoMedia




is it possible to create a cadfile server programmatically in C#. I had searched the web, the forum and the dokumentation, but i found nothing about that. It would be nice if I could get an codesnippet as an example.



Sincerely yours

Technical Evangelist
Posts: 567
Registered: ‎09-11-2015

Re: Create a Cadserver in GeoMedia

Theoretically yes. The csd file is nothing but renamed Access database file (mdb - the Office 97 or 2003 version, not the new mdbx format). So if you have the proper driver (MS JET) available in your programming language, you can create it from your app. However, the database structure is private and undocumented, so a bit of reverse engineering should be applied. I have no code snippet for this.



Occasional Contributor
Posts: 5
Registered: ‎12-20-2017

Re: Create a Cadserver in GeoMedia



i had created a cadfile server. However it wont work to add this csd to GeoMedia. I used this code to import this csd into GeoMedia.


                tFileInfo = @"C:\Warehouses\CSD188.csd";
                gm = (Intergraph.GeoMedia.GeoMedia.Application)Marshal.GetActiveObject("GeoMedia.Application");
                mw = (Intergraph.GeoMedia.GeoMedia.MapWindow)gm.ActiveWindow;
                Intergraph.GeoMedia.MapviewLib.GMMapView view = (Intergraph.GeoMedia.MapviewLib.GMMapView)mw.MapView;

                doc = (Intergraph.GeoMedia.GeoMedia.Document)gm.Document;
                conns = (Intergraph.GeoMedia.PClient.Connections)doc.Connections;
                Connection pConn = new Connection
                    Application = gm,
                    CoordSystemsMgr = view.CoordSystemsMgr,

                    ConnectionName = "Test",
                    Description = "Test",
                    Location = tFileInfo,
                    Mode = 0,
                    Name = "Test",
                    Type = "GCAD.GDatabase",

                pConn.Connect(); // I already could connect to the connection.
                Intergraph.GeoMedia.PClient.GDatabase objDatabase = null;
                objDatabase = (Intergraph.GeoMedia.PClient.GDatabase)pConn.Database;               
                conns.Append(pConn); // If I understood this right that will add the before definde connection to the warehouse connections. But every time I'll add this to my GeoMedia I got this Exeception : "No such interface supported". That connection is also displayed unter the other connctions...


I guess I missed something but I dont got this.