|
POST
|
Brian, Did you ever have any luck with this? I have the same problem. I have multiple routes that work perfectly fine in ArcMap but in using the routing service I created, I'm getting this error on all my routes but one.
... View more
02-09-2014
07:56 AM
|
0
|
0
|
641
|
|
POST
|
I needed to use IStandalonetable. Updated code below. Thanks IStandaloneTable pStTable;
ITable pFromTable;
ILayer pTableLayer;
IDataLayer pDatalyr;
pTabCollection = pMap as IStandaloneTableCollection;
for (int u = 0; u < pTabCollection.StandaloneTableCount; u++)
{
tbltracker = 0;
pStTable = pTabCollection.StandaloneTable; //added
pDatalyr = pStTable as IDataLayer;
pFromTable = pStTable as ITable;
... View more
05-10-2012
07:54 AM
|
0
|
0
|
565
|
|
POST
|
I'm using C# to get the actual datasourcename of each layer in the Table of Contents of an MXD (example: sde.SomeDatabase.Cities is the datasourcename for the Cities Table). My code is blowing up when I try to capture this datasourcename so is my code not right or are there better ways to capture this name for a Table?
IStandaloneTable pStTable;
ITable pFromTable;
ILayer pTableLayer;
IDataLayer pDatalyr;
pTabCollection = pMap as IStandaloneTableCollection;
for (int u = 0; u < pTabCollection.StandaloneTableCount; u++)
{
pFromTable = pTabCollection.StandaloneTable as ITable;
pDatalyr = pFromTable as IDataLayer;
string test = pDataLayer.DataSourceName.ToString().ToUpper(); //Code blowing up here
//.......... additional code
}
... View more
05-10-2012
07:30 AM
|
0
|
1
|
1049
|
|
POST
|
You check the type of the layer. In C# that's the Is operator. If (layer Is IGroupLayer) then... You can access the layers within a group layer using the ICompositeLayer interface. For your code to be truly robust, you'll need to handle the possibility that group layers can contain other group layers so you can't just simply loop through the layers. You'll need to write a routine that loops through the layers within the group layer and updates the datasources of the feature layers and calls itself recursively for the group layers. As for changing the datasource, that's done the same way you did it for the mxd. That's perfect Neil. Thanks again.
... View more
03-27-2012
06:05 AM
|
0
|
0
|
1283
|
|
POST
|
With a layer file, you open it using ILayerFile and get the layer reference from the Layer property. Only one layer can be stored in a layer file. However, this layer may be a group layer so you'll need to handle that possibility. I got the piece of code working to update the Layer file if it is just one Layer using one of your older post (http://forums.esri.com/Thread.asp?c=159&f=1707&t=303925)(thanks). Haven't quite figured out how to check the Layer file to see if it's a group layer and then update each layer accordingly. In my MXD code I was easily able to do this using IMap.get_Layers()
... View more
03-27-2012
05:07 AM
|
0
|
0
|
1283
|
|
POST
|
With a layer file, you open it using ILayerFile and get the layer reference from the Layer property. Only one layer can be stored in a layer file. However, this layer may be a group layer so you'll need to handle that possibility. Hi Neil, thanks for the quick response. ILayerFile was what I was using so I'm glad I was going in the right direction. 2 questions: Using the code I have above for the LYR file, how can I modify that code to see what the Data Source is of the Layer in the LYR file and then change it to an alternate Data Source? Lastly, if a group layer exist, how can I loop through that group layer to perform the above question? Thanks Neil.
... View more
03-27-2012
04:11 AM
|
0
|
0
|
1283
|
|
POST
|
Did you already try ILayerFile.ReplaceContents? http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#//00490000004v000000 Hi Jeff- If I'm understanding ILayer.ReplaceContents correctly then it requires a ILayer which is fine but I think I need to get a list of layers in the LayerFile first right (similiar to MXD)? Or is there a better approach to this?
... View more
03-26-2012
12:42 PM
|
0
|
0
|
1283
|
|
POST
|
Greetings, I'm building an Add-in that lets users change datasources of all MXD's and Layer files in a directory of their choice. I have the MXD part working but I cannot figure out the Layer file part. In my code below, I've gathered a list of Layer files in this directory but now I need to open each layer file and change the data source information. Can anyone shed some light on this? Many thanks //Now Loop through LYR Files if there are any and Process them.. for (int y = 0; y < LYList.Count; y++) { string test = LayerFileLocation + "\\" + LYList .ToString(); ILayerFile l = new LayerFileClass(); l.Open(LayerFileLocation + "\\" + LYList .ToString()); //I'm not sure what to do with a Layer file from here. With an MXD I used the below code to loop through each layer and process it using IMapAdmin2.FireChangeFeatureclass() } Here is what I did for MXD's.. UID pUID = new UIDClass(); pDoc.Open(MXDLocation + "\\" + AL .ToString());//+ fi.Name); for (int i = 0; i < pDoc.MapCount; i++) { pMap = pDoc.get_Map(i); UID uid = new UIDClass(); //uid.Value = "{EDAD6644-1810-11D1-86AE-0000F8751720}"; // IGroupLayer uid.Value = "{40A9E885-5533-11d0-98BE-00805F7CED21}"; //IFeatureLayer IEnumLayer layers = pMap.get_Layers(uid, true); //Returns all layers including layers in grouplayers layers.Reset(); pFeatureLayer = layers.Next() as IFeatureLayer; while (pFeatureLayer != null) {...Etc..etc
... View more
03-26-2012
11:36 AM
|
0
|
7
|
5043
|
|
POST
|
Greetings, I have a small .NET script that uses ArcObjects such as CADtoFeatureClass to convert DWG files to ESRI FeatureClasses. This standalone program has been working great with DWGs created in previous versions of AutoDesk 2010 but I've been told that my code is now not working on DWGs from AutoDesk 2010. As a temporary solution I can have the users save their DWG files in AutoCAD to previous versions but to permanently fix the problem I need to find out more details. So does anyone know or has anyone had a similar issue in trying to convert DWG files to FeatureClasses using these types of ArcObjects on AutoDesk 2010 DWG files? Thanks for any advice. best regards,
... View more
06-23-2011
11:45 AM
|
0
|
0
|
388
|
|
POST
|
This is a setting in an config file in the REST WebService. However I would generally recommend against this. It's a LOT of features to bring down on the client and is not going to perform well (slow startup-time and poor rendering performance). Instead render your features using ArcGISDynamicMapServiceLayer instead of FeatureLayer, which is specifically optimized to render map objects very fast. Hi Morten- Is this setting you are referring to called UserServiceCacheLimit?? Is the file you are referring to in inetpub\wwwroot\ArcGIS\rest\rest.config? Also if I make a change to that file do I need to restart the SOM to see changes? many thanks
... View more
06-06-2011
04:24 AM
|
0
|
0
|
573
|
|
POST
|
Great explanation Chris, I appreciate it. How can I increase the features to something higher than a 1,000 features?
... View more
06-02-2011
09:26 AM
|
0
|
0
|
573
|
|
POST
|
I'm wondering if the TimeSlider will work on data that is cached? Reason being, that I'm getting some inconsistent results on my Silverlight application that uses a TimeSlider. I'm pretty much using the exact sample that ESRI has here (http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#TimeMapService) but the Dynamic Service I'm using has two featureclasses that have over 10,000 features and my Silverlight Application doesn't always show all the data in TimeSlider mode Dynamically creating the cache
... View more
05-31-2011
01:19 PM
|
0
|
5
|
928
|
|
POST
|
I was able to figure this out using a Calendar control and tieing the user selection into the timeslider control.
... View more
05-31-2011
07:57 AM
|
0
|
0
|
230
|
|
POST
|
I'm using the basic ESRI silverlight sample for the TimeSlider (http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#TimeMapService) and I'm wondering if there is a way to add a textbox or calendar control that will allow a user to automatically jump to a moment in time on the TimeSlider control? Thanks for any help. Best regards,
... View more
05-31-2011
05:57 AM
|
0
|
1
|
688
|
|
POST
|
The intersect tool does most of the work for you (when you choose the line and polygon feature classes as input). It chops up your lines into intersecting segments and dissolves them based on the polygon that chopped it. If you're working with a geodatabase feature class, there will be a length field showing you how much of the line intersects which polygon. There will be a field with the line ID and a field with the polygon ID. Then you can use the Summary Statistics Tool to count the number of segments each line was chopped into (to get the number of polygons a line crossed). For your model, you should just have the intersect tool feeding into the summary statistics tool. Thanks Darren- I will try this. Thank you for the insight.
... View more
04-07-2011
07:41 AM
|
0
|
0
|
1447
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 11-15-2023 01:27 PM | |
| 1 | 05-02-2017 11:40 AM | |
| 1 | 06-16-2010 08:09 AM | |
| 1 | 05-02-2017 10:04 AM |
| Online Status |
Offline
|
| Date Last Visited |
10-16-2025
02:03 PM
|