POST
|
Dan Patterson: Hmmm some questions where is in_raster defined? where is segments defined? what are you going to call the output file? is your environment location defined somewhere? What do you to call you output files? are you satisfied just to have a changing number appended to a base filename? That's all for now in_raster, seg_raster, and the output file (segements) are defined in the script before the three lines I provided. They are simple file locations on the local disk (e.g., D:\\path\\to\\dir\\raster.img) Which environment settings are you referring to? I have experimented with setting arcpy.env.workspace and scratchWorkspace. I assume the scratch workspace should be different for each process? The output files need to be named based on the input file, not an incrementing number. Thanks!
... View more
09-22-2015
08:25 AM
|
0
|
1
|
327
|
POST
|
Hello. I am using a Python script to run the SegmentMeanShift tool of Spatial Analyst, via arcpy: arcpy.CheckOutExtension("Spatial") seg_raster = SegmentMeanShift(in_raster, "20", "15", "10") seg_raster.save(segments) Running one instance of the tool works just fine. However, calling a new instance (on a different dataset) immediately fails. Does anyone know how to successfully kick off multiple processes? It needs to be such that the script is called independently for each dataset (i.e., I can't know ahead of time how many datasets I will need to process; a second, or third, etc., process may be called at any time after the first one). Thanks.
... View more
09-22-2015
07:47 AM
|
0
|
3
|
2709
|
POST
|
When I attempt to import a feature class into my postgres database, it insists on looking for a schema named "postgres" and telling me "schema postgres does not exist." Ah, but I don't want to import into a schema named "postgres." I am connected to the database with my user name, let's say "myuser" and there is a schema called "myuser." Why does it insist on trying to find a schema "postgres"?
... View more
03-24-2015
08:04 AM
|
0
|
2
|
3600
|
POST
|
Hi. I have an ArcMap add-in that displays a form and responds to key press events to edit fields in an attribute table. I have a save edits function built in, but it occasionally throws this error: System.Runtime.InteropServices.SEHException: External component has thrown an exception upon trying to stop and save edits. I should note that I have the add-in deployed on computers that have ArcMap 10.1, 10.2, and 10.3, and it only occurs on the ones with 10.1 Any thoughts?
... View more
03-13-2015
08:51 AM
|
0
|
0
|
3519
|
POST
|
I am trying to add a custom accelerator to the table using the IAcceleratorTable.Add() method. This method returns True if successful and False if not. It seems that there are some keys that can be successfully added to the table and others that cannot. For instance, I can add an accelerator for the semicolon key, but not the A key. This is even after I have looped through the table and deleted each accelerator. Can anyone explain this?
... View more
03-06-2015
12:15 PM
|
0
|
0
|
9421
|
POST
|
Hello, I have written a pretty simple add-in (in C# .NET) that does some symbolizing on raster (TIF) layers, changing their renderers in the process. When I remove these raster layers from ArcMap, sometimes I need to rename them in Windows, but I cannot because a message appears telling me they are still open in ArcMap. This does not happen if I do not use the add-in on the files. I have tried using ReleaseComObject on the raster layers before exiting the add-in, but this does not do the trick. I should point out that when the raster layers are first added to ArcMap, tif.ovr and .tif.aux.xml files are created. Could the problem have something to do with those? Thanks, Evan
... View more
06-10-2014
08:52 AM
|
0
|
3
|
2496
|
POST
|
As far as I know, there is no comprehensive list that maps license levels to functionality. If your application has a requirement that it run under a certain license level then you should be developing and testing under that same license level. This will keep you from writing something that requires a higher license level. That's pretty much what I expected, thanks. If only the "requirements" didn't change. Evan.
... View more
05-30-2014
06:28 AM
|
0
|
0
|
166
|
POST
|
Hello, I am running Advanced (ArcInfo) and I am developing an add-in that will be deployed to multiple computers around the company. We need to know what license level each machine should be running. Is there a way to determine if an add-in will work on a computer with a lower license level, without physically installing and trying every possible function of the add-in on the target machine to see if it will fail? Will an add-in developed in Advanced run in Standard? Thanks, Evan
... View more
05-29-2014
12:00 PM
|
0
|
2
|
427
|
POST
|
Evan, I just tried to replicate your problem in VBA and it returns Nothing, which leads me to think you have discovered a bug. I thought the approached discussed here may work but that returns Nothing to. I reckon ESRI have broken this interface as this thread I link to has no discussion about the Messages object. Duncan Thanks for investigating Duncan. I've come up with a bit of a workaround for my purposes. Get a reference to the Geoprocessor and add a MessagesCreated event handler: GP = new Geoprocessor();
GP.MessagesCreated += new EventHandler<MessagesCreatedEventArgs>(GP_MessagesCreated); A rough event handler, just to prove it works and display each message as it's created, looks like this: void GP_MessagesCreated(object sender, MessagesCreatedEventArgs e)
{
IGPMessages msgs = e.GPMessages;
IGPMessage msg = msgs.GetMessage(msgs.Count - 1);
Debug.Print(msg.Description);
} (And of course unwire the event handler afterward.) Evan.
... View more
05-23-2014
10:08 AM
|
0
|
0
|
301
|
POST
|
So earlier I figured out how to launch a geoprocessing tool's dialog box from a .NET add-in: IGPToolCommandHelper cmdHelper = new GPToolCommandHelperClass();
cmdHelper.SetToolByName("MyToolbox.tbx", "MyToolName");
cmdHelper.Invoke(null); Since then I've tried to use .InvokeModal to retrieve gp messages: bool ok = true;
ESRI.ArcGIS.Geodatabase.IGPMessages msgs;
msgs = new ESRI.ArcGIS.Geodatabase.GPMessagesClass();
cmdHelper.InvokeModal(0, null, out ok, out msgs); But the msgs object always returns null. What I want is essentially the output that appears in the geoprocessing window while the tool is running. Any ideas? Thanks, Evan.
... View more
05-22-2014
02:05 PM
|
0
|
2
|
896
|
POST
|
Hello, Is it possible to use a button on a form in an add-in to launch a custom geoprocessing script (contained in a custom toolbox) such that the window pops up asking for parameters? I want the window to appear just as if you are clicking on the script directly in the ArcToolbox window, so that you can choose parameters on that window and click OK to run the script. Thanks, Evan. Well that was easy after all: IGPToolCommandHelper cmdHelper = new GPToolCommandHelperClass(); cmdHelper.SetToolByName("MyToolbox.tbx", "MyToolName"); cmdHelper.Invoke(null); ...and you need to reference ESRI.ArcGIS.GeoprocessingUI.
... View more
05-22-2014
10:39 AM
|
0
|
0
|
176
|
POST
|
Hello, Is it possible to use a button on a form in an add-in to launch a custom geoprocessing script (contained in a custom toolbox) such that the window pops up asking for parameters? I want the window to appear just as if you are clicking on the script directly in the ArcToolbox window, so that you can choose parameters on that window and click OK to run the script. Thanks, Evan.
... View more
05-22-2014
09:02 AM
|
0
|
1
|
604
|
POST
|
This is driving me batty. I have an add-in that works fine on 10.1 but not 10.0. With some judiciously placed breakpoints and exception catchers, I can see that the problem has to do with adding an ItemAdded event handler. Please see the attached exception message (sorry about the redacted file names). Does anyone have a clue how to make this work? Thanks, Evan.
... View more
05-08-2014
07:25 AM
|
0
|
1
|
1544
|
POST
|
Hello, I want to create an add-in button that programmatically applies contrast, brightness, and gamma to a raster layer. I found the IRasterShader interface in the documentation, but no examples of how to use it. My efforts to use it have not been successful thus far. Right now I'm doing something like: IRasterLayer rLayer = map.get_Layer(index); IRasterShader rShader = rLayer as IRasterShader; rShader.Brightness = brightValue; But rShader is null. Does anyone have any insight? Thanks.
... View more
04-28-2014
06:32 AM
|
0
|
1
|
614
|
POST
|
Boom! That does it, thank you Sean. I didn't even think that IFeature.Store() might not be necessary. Evan. Make sure you're not calling IFeature.Store in the event as this will re-fire the behavior. Its called internally once the event is complete. public class EditorExtension1 : ESRI.ArcGIS.Desktop.AddIns.Extension
{
private IEditEvents_Event _editEvents;
private int i = 0;
public EditorExtension1()
{
}
protected override void OnStartup()
{
IEditor theEditor = ArcMap.Editor;
_editEvents = theEditor as IEditEvents_Event;
_editEvents.OnChangeFeature += new IEditEvents_OnChangeFeatureEventHandler(_editEvents_OnChangeFeature);
}
void _editEvents_OnChangeFeature(ESRI.ArcGIS.Geodatabase.IObject obj)
{
IFeature feature = obj as IFeature;
feature.set_Value(feature.Fields.FindField("point_x"), (i = i + 1));
}
... View more
04-23-2014
06:27 AM
|
0
|
0
|
656
|
Title | Kudos | Posted |
---|---|---|
1 | 12-23-2016 08:30 AM | |
1 | 12-23-2016 07:20 AM |
Online Status |
Offline
|
Date Last Visited |
02-18-2022
04:10 PM
|