Hexagon Geospatial
MENU

Developer Discussions

Discuss topics with other Hexagon Geospatial Power Portfolio developers and experts to get the most out of our products.
Showing results for 
Search instead for 
Do you mean 
Reply
Frequent Contributor
Posts: 159
Registered: ‎01-14-2018

OutputToTableService Invalid Coordinate System GUID

[ Edited ]

Dear all Smiley Happy

 

I want to export a query to a mdb file, so I connected to an mdb, then used the OutputToTableService as follows:

 

 

 

GMOUTPUTTOTABLESERVICE.OutputToTableService oTTS =
_currentApplication.CreateService("GeoMedia.OutputToTableService") as GMOUTPUTTOTABLESERVICE.OutputToTableService;

oTTS.InputRecordset = cssTransformPipe_Lines as GDO.GRecordset;

oTTS.OutputConnection = pClientConnectionMDB;
oTTS.OutputTableName = "Join_of_LIN_and_LI2";
oTTS.OutputMode = GMOUTPUTTOTABLESERVICE.gmopmConstants.gmopmCreateNewTable;
oTTS.NewTableKeyMode = GMOUTPUTTOTABLESERVICE.gmntkmConstants.gmntkmNewKey;
oTTS.NewTableAutonumberMode = GMOUTPUTTOTABLESERVICE.gmntamConstants.gmntamPreserveValues;
oTTS.DisableModificationLogging = false;
oTTS.DisableTransactions = false;
oTTS.OutputCoordSystem = cssTransformPipe_Lines.CoordSystemsMgr.CoordSystem as Interop.IGMCoordSystem;
oTTS.OutputCoordSystem.GUID = cssTransformPipe_Lines.CoordSystemsMgr.CoordSystem.GUID;
oTTS.OutputLogFileName = @"C:\Users\A\Desktop\Edited\Laboratory\mdb.log";

oTTS.Execute();

 it gives me the error :"Invalid Coordinate System GUID"

 

What oTTS.OutputCoordSystem should I use?

it says its type is Interop.IGMCoordSystem

 

Your help is appreciated

 

 

______________________

Additional Information:

 

 

I previously created cssTransformPipe_Lines as follows:

 

PDBPipe.CSSTransformPipe cssTransformPipe_Lines = new PDBPipe.CSSTransformPipe();
cssTransformPipe_Lines.InputRecordset = (PDBPipe.GRecordset)_Lines_Joined_GRecordset;
cssTransformPipe_Lines.CoordSystemsMgr = coordSystemsMgr;
cssTransformPipe_Lines.OutputCSGUID = coordSystemsMgr.CoordSystem.GUID;
cssTransformPipe_Lines.InputGeometryFieldName = "Geometry";

 

 

and pClientConnectionMDB as follows:

 

PClient.Connection pClientConnectionMDB = _currentApplication.CreateService("GeoMedia.Connection") as PClient.Connection;
pClientConnectionMDB.Type = "Access.GDatabase";
pClientConnectionMDB.Name = "mdb connection";
pClientConnectionMDB.Location = @myProjectfolder;
pClientConnectionMDB.Mode = PClient.ConnectionConstants.gmcModeReadWrite; // 1
pClientConnectionMDB.CoordSystemsMgr = coordSystemsMgr;
pClientConnectionMDB.Connect();

and coordSystemsMgr as follows:

 

 

Interop.CoordSystemsMgr coordSystemsMgr = new Interop.CoordSystemsMgr();
coordSystemsMgr.CoordSystem.LoadFromFile(@"C:\Users\A\Desktop\SDRFiles\EgyptRedBelt.csf");
coordSystemsMgr.CoordSystem.Name = "EgyptRedBelt";
coordSystemsMgr.CoordSystem.MonikerFromEPSGCode(out moniker1, 22992, false);

 

Best Regards

Khaled

 

 

Do you need immediate support?
Please submit a Ticket through our
Development Ticket Portal.