POST
|
pMxDoc.FocusMap This returns an IMap reference. You need to QI (or cast) to the Map class if you want to use addTable(). Thanks for sticking with me, Lee. I QI'd the IMap to an ITableCollection and used its AddTable() method. This results in: Data Type: Standalone Table Table Name: MyTable_Features Table Type: XY Event Source Location: C:\data\database.mdb Has Object-ID Field: Yes Still not quite there. Still shooting for: Data Type: XY Event Source Location: C:\data\database.mdb Table: C:\data\database.mdb\MyTable X Field: myX Y Field: myY Has Object-ID Field: Yes I feel like I'm painfully close...
... View more
04-04-2013
06:04 AM
|
0
|
0
|
515
|
POST
|
IMxDocument pMxDoc = m_app.Document as IMxDocument;
IMap map = pMxDoc.FocusMap; m_app is set within the OnCreate() method of the BaseCommand: if((hook) is IMxApplication)
m_app = (IApplication)hook;
... View more
04-03-2013
01:37 PM
|
0
|
0
|
515
|
POST
|
Thanks for the response. However, I don't see an AddTable() method for the IMap interface.
... View more
04-03-2013
12:27 PM
|
0
|
0
|
515
|
POST
|
I can add a table as an XYEventSource from an Access database, with the following code. This works. My problem is described after the code block.
srWorkspace = ao.OpenAccessWorkspace(dataSource);
srTable = ao.OpenTable(srWorkspace, "MyTable");
IDataset dataSet = srTable as IDataset;
IName tableName = dataSet.FullName;
IXYEvent2FieldsProperties xyEvent2FieldsProperties = new XYEvent2FieldsPropertiesClass();
xyEvent2FieldsProperties.XFieldName = "myX";
xyEvent2FieldsProperties.YFieldName = "myY";
IXYEventSourceName xyEventSourceName = new XYEventSourceNameClass();
xyEventSourceName.EventProperties = xyEvent2FieldsProperties;
xyEventSourceName.EventTableName = tableName;
ftrLayer = new ESRI.ArcGIS.Carto.FeatureLayerClass();
SpatialReferenceEnvironment spatRefEnv = new ESRI.ArcGIS.Geometry.SpatialReferenceEnvironmentClass();
IGeographicCoordinateSystem geoCS = spatRefEnv.CreateGeographicCoordinateSystem((int)ESRI.ArcGIS.Geometry.esriSRGeoCSType.esriSRGeoCS_WGS1984);
geoCS.SetFalseOriginAndUnits(-180, -90, 1000000);
xyEventSourceName.SpatialReference = geoCS as ESRI.ArcGIS.Geometry.ISpatialReference;
IName xyName = xyEventSourceName as IName;
IXYEventSource xyEventSource = xyName.Open() as IXYEventSource;
IStandaloneTableCollection pTableCollection = map as IStandaloneTableCollection;
IStandaloneTable standaloneTable = new StandaloneTableClass();
standaloneTable.Table = srTable;
pTableCollection.AddStandaloneTable(standaloneTable);
ftrLayer.FeatureClass = xyEventSource as IFeatureClass;
ftrLayer.Name = "My Table";
map.AddLayer(ftrLayer);
The problem I'm having is that it's adding the table to the map as a feature layer with a feature class, and I don't want that. I want it to behave exactly as if the user right-clicked on the table in ArcMap and chose the "Display XY Data..." menu item. Right-clicking on the layer created as above and choosing Properties shows this for the source: Data Type: XY Event Source Location: C:\data\database.mdb Feature Class: MyTable_Features Feature Type: Simple Geometry Type: Point However, if you conduct the Display XY Data operation manually in ArcMap on a standalone table added to the TOC, the following shows for the source, and this is what I'm after: Data Type: XY Event Source Location: C:\data\database.mdb Table: C:\data\database.mdb\MyTable X Field: myX Y Field: myY Has Object-ID Field: Yes What in the world am I doing wrong? Thank you for any assistance! Mike
... View more
04-03-2013
09:17 AM
|
0
|
8
|
891
|
POST
|
Hello, Anyone else having an issue with exporting data from a table in a file geodatabase using an IQueryFilterDefinition postfix clause in ArcGIS Desktop 10.1? Essentially: IQueryFilter queryFilter = new QueryFilterClass();
queryFilter.WhereClause = "InspDate >= CURRENT_DATE - 365";
queryFilter.SubFields = "*";
IQueryFilterDefinition queryFilterDef = (IQueryFilterDefinition)queryFilter;
queryFilterDef.PostfixClause = "order by SiteID asc, InspDate desc";
ICursor cursor = table.Search(queryFilter, false);
IExportOperation exporter = new ExportOperationClass();
exporter.ExportTable(datasetName, queryFilter, cursor as ISelectionSet, outputName, 0);
This works in 10.0. In 10.1 it results in an exception: "Error: The owner SID on a per-user subscription doesn't exist (Exception from HRESULT: 0x80040207)" With the proper change of the query filter's WhereClause to "InspDate >= DATEADD(day, -365, GETDATE())", this same code works on both 10.0 and 10.1 systems using SDE. So, only file geodatabases in 10.1 seem to be giving the problem. Any ideas?
... View more
01-09-2013
08:26 AM
|
0
|
3
|
3172
|
POST
|
Right, I realize the URL has changed, but still no luck. Just get a nondescript WebException when attempting a mobileServiceConnection.CreateCache() call.
... View more
12-06-2012
07:47 AM
|
0
|
0
|
433
|
POST
|
Ah, OK. My situation is that I can't get 10.0 on the mobile to talk with a 10.1 server. Thanks for your response.
... View more
12-06-2012
05:19 AM
|
0
|
0
|
433
|
POST
|
André, did you resolve this issue? I'm coming up with the same.
... View more
12-05-2012
07:43 AM
|
0
|
0
|
433
|
POST
|
Hello, In my FeatureDataGrid, I have a DataGridTextColumn bound to a numeric field in my graphics layer. What I would like to accomplish is: If another field in the graphics layer has a certain value, I would like to NOT display a number from the bound field, but rather display "N/A". I would also like to prevent edits to the field. I'm drawing a huge blank. Can someone please guide me on how to achieve this? Thank you in advance, and regards, Mike
... View more
09-28-2012
07:40 AM
|
0
|
0
|
554
|
POST
|
Thanks Dominique - I've seen that example, and unfortunately that's not what I'm after. I need to display data from more than one feature layer in a single MapTip. Per original post: "show certain attributes from that feature as well as related data from feature layer 2 in a MapTip"
... View more
09-14-2012
06:32 AM
|
0
|
0
|
160
|
POST
|
I realize that multiple feature layers can be handled, each with MapTips; however I'm uncertain as to how to perform the procedure I have indicated. I'm going to guess that I'll have to hook into a mouse event and when it slows to a certain point, find the nearest feature from layer 1, then fire off an async call to get the associated data from layer 2, then display it. ?
... View more
09-14-2012
06:05 AM
|
0
|
0
|
160
|
POST
|
Not sure if this is possible; figured I'd toss it out here in case someone had an idea for me. I have two feature layers that are optional in the map; they may or may not be present. If they are present, I would like to be able to let the user hover the mouse over a feature in feature layer 1, then show certain attributes from that feature as well as related data from feature layer 2 in a MapTip. Any ideas? Thanks in advance, Mike
... View more
09-13-2012
02:34 PM
|
0
|
4
|
402
|
POST
|
Sorry - also need to mention that the features are being created on the mobile, one per second.
... View more
08-14-2012
12:57 PM
|
0
|
0
|
126
|
POST
|
And ... I'd rather not actually have the features in this point layer selectable, but I'm not sure how else to get them to display. Do I have to create a custom graphics layer?
... View more
08-14-2012
08:57 AM
|
0
|
0
|
126
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|