[fdo-users] Visual data filtering

Zdeněk Neustupa zdenek.neustupa at centrum.cz
Thu Mar 15 07:44:11 EDT 2012


Hello.

 

I am quite new to FDO so please be patient with me.

I have a question which could seem little silly.

 

I enclose a code snippet which I use to load data from SHP files during an
opening of DWG file to which the SHP data is onnected.

 

What I need is:

If I SELECT data using a select command, I need to show this result in
AutoCAD Civil 3D as well (visually).

Is there anything in FDO what I can use to do this, or is it no longer a
part of FDO?

 

Thank you very much for your answer.

 

Zdenek Neustupa

 

 

public void LoadData(string featClass)

{

string name =
Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDo
cument.Name;

string myShpFileOrDirectory = name.Remove(name.LastIndexOf('\\') + 1) +
"geo_2011";

 

OSGeo.FDO.IConnectionManager mConnMgr =
OSGeo.FDO.ClientServices.FeatureAccessManager.GetConnectionManager();

OSGeo.FDO.Connections.IConnection mProvConn =
mConnMgr.CreateConnection("OSGeo.SHP");

OSGeo.FDO.Connections.IConnectionInfo connInfo = mProvConn.ConnectionInfo;

OSGeo.FDO.Connections.IConnectionPropertyDictionary connPropDict =
connInfo.ConnectionProperties;

 

connPropDict.SetProperty("DefaultFileLocation", myShpFileOrDirectory);

 

mProvConn.Open();

OSGeo.FDO.Commands.Feature.ISelect selCmd =
(OSGeo.FDO.Commands.Feature.ISelect)mProvConn.CreateCommand(OSGeo.FDO.Comman
ds.CommandType.CommandType_Select);

 

selCmd.SetFeatureClassName(featClass);

selCmd.SetFilter("CAO>45.0");

 

OSGeo.FDO.Commands.Feature.IReader myReader = selCmd.Execute();

 

while (myReader.ReadNext())

{

       // put SELECT result to data grid and show it in Win Form to user

}

 

myReader.Close();

myReader.Dispose();

mProvConn.Close();

mProvConn.Dispose();

}

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/fdo-users/attachments/20120315/f817682e/attachment.html


More information about the fdo-users mailing list