POST
|
Thanks for the response Jeff. In my case, my where clause is correct, I have confirmed it.
... View more
01-28-2015
10:08 PM
|
0
|
0
|
1341
|
POST
|
Hello, We have a simple code for selecting features based on attribute query using IFeatureSelection. However, it throws COMexception at the line where it selects the features. Error is Exception from HRESULT: 0x80041538. Initially I suspected that problem would be with the syntax of the where clause, but even simpler where clauses like "OBJECTID = 500'" also throw error. I have confirmed that the features being queried actually exist in the feature class.Error screenshot is attached here. Code: Public Sub LayerSelectFeatures(ByRef pFlayer As IFeatureLayer, ByVal strFWhereClause As String, ByVal enumSelectionResult As esriSelectionResultEnum) Try Dim pMxDoc As IMxDocument pMxDoc = g_pApp.Document Dim pMap As IMap pMap = pMxDoc.FocusMap Dim pActiveView As IActiveView pActiveView = pMap Dim pQueryFilter As IQueryFilter pQueryFilter = New QueryFilterClass pQueryFilter.WhereClause = strFWhereClause Dim pLayerSelection As IFeatureSelection pLayerSelection = TryCast(pFlayer, ESRI.ArcGIS.Carto.IFeatureSelection) pActiveView.PartialRefresh(esriViewDrawPhase.esriViewGeoSelection, Nothing, Nothing) pLayerSelection.SelectFeatures(pQueryFilter, esriSelectionResultEnum.esriSelectionResultAdd, False) 'Erractic Line pActiveView.PartialRefresh(esriViewDrawPhase.esriViewGeoSelection, Nothing, Nothing) System.Runtime.InteropServices.Marshal.ReleaseComObject(pQueryFilter) pQueryFilter = Nothing Catch ex As Exception End Try End Sub ArcMap Version : 10.2.1 Database: SDE on Oracle 11 g Language : VB.Net I would appreciate if I can get help to fix this issue. PS: When I use esriSelectionResultNew instead of esriSelectionResultAdd, it works. Thanks.
... View more
01-26-2015
05:39 AM
|
0
|
7
|
6809
|
POST
|
Hello, We are designing an MXD to create cache for ArcGIS for Windows Mobile. In this process,we are facing an issue of changing the symbology of a layer at different scales. When we look at an ESRI online map service World_street_Map at the url http://server.arcgisonline.com/arcgis/rest/services/World_Street_Map/MapServer,we see that the symbology of the layers get changed as we zoom in or out.We observed the above mentioned map service in the browser but found that it contained only one layer. So could not understand how they did it for this. So, any help on this issue would be appreciated. We have to change the symbology of various layers like,Streets, divisions, areas etc at different scales, for instance, at the scale of 25000 Streets should like a single line,however, as we zoom in for scale say,1000,it should show more details. We are aware that,we may achieve something like this, by making multiple copies of the desired layer and settings different symbologies at different reference scales. However, we would like to know is there any other way of doing this. Thanks in advance,
... View more
01-18-2015
10:19 PM
|
1
|
1
|
4422
|
POST
|
Richard, Thanks for the reply. Much appreciated. So to summarize, currently there is no configuration parameter to control the scale of Go to X,Y. May be ESRI will take a note of this. Thanks once again, S.
... View more
11-10-2014
12:09 AM
|
0
|
1
|
700
|
POST
|
Hello, We are using ArcMap 10.2.1 and have a question regarding the Go to X Y tool. We have observed that this tool does not zoom in enough to the specified x and y coordinates. For instance if we are zoomed to the full extent of the data in the ArcMap and we type in the coordinates for a land plot, the tool just zooms in but not in enough to locate the plot. The extent which we get after running Go to X,Y makes hard to locate the desired location. I have attached the video for this. So I would like to know how to make Go to X Y tool zoom in further for a given pair X and Y coordinates. Thanks, S.
... View more
11-04-2014
09:47 PM
|
0
|
4
|
3160
|
POST
|
Thanks Mohini for your help. Appreciate it. It helped a lot.
... View more
08-26-2014
05:33 AM
|
0
|
0
|
574
|
POST
|
Hi, My scenario is as below . 1. I am opening an MXD from a standalone exe file.This is fine, the MXD is getting opened successfully. 2. I have developed an ArcMap extension and it it's Startup event, I want to call the the VBA macro inside the MXD. 3. The problem is here, I get an error "Error running VBA code : Error in macro" 4. The macro works fine manually, I means I open the MXD and run the macro manually, it runs fine. Code to tun the macro is as below:
private bool RunMyMacro(IApplication pApplication)
{
try
{
IMxDocument pMxDoc = pApplication.Document as IMxDocument;
IMapDocument pMapDoc = pMxDoc as IMapDocument;
//check the name of the MXD. IF it is what we wantm run the macro
if (String.IsNullOrEmpty(pMapDoc.DocumentFilename) == false)
{
if (pMapDoc.DocumentFilename.Contains("MyMXDName"))
{
//run the macro
IVbaApplication pVBAApps = pApplication as IVbaApplication;
pVBAApps.RunVBAMacro("Project", "ThisDocument", "Trace_Transformers_LV", null);
return false;
}
}
return true;
}
catch (Exception ex)
{
string errMsg = ex.Message;
string stkTrace = ex.StackTrace;
return false;
}
}
//Code of StartUp event of an extension
public void Startup(ref object initializationData)
{
IApplication pApps = initializationData as IApplication;
RunMyMacro(pApps);
...
}
Earlier, the macro was getting called from the EXE it self and it works fine .However, after running fine for a week or so, it starts throwing an error. To work around this, I'm trying to call the macro from the extension, but it is also not working.Even a simple HelloWorld macro is not getting called from the extension. I would really appreciate any help on this issue. Thanks, S.
... View more
07-23-2014
01:53 AM
|
0
|
1
|
2784
|
POST
|
Hello, I'm using C#.net and ArcObjects 10.2.1. I need to create a custom menu that will have my custom commands and some sub menus inside it, all this dynamically. I could create a menu using IMenuDef however stuck on creating a nested ( sub) menu to hold my custom commands. I have attached the screen shot one typical sub-menu for clarification. I guess have to use IMenuItem or some interface like that but I'm not sure. I tried to follow the example at the URL : arcobjects - How to create dynamic sub-menu in ArcMap? - Geographic Information Systems Stack Exchange but could not really understand it. So, any help will be appreciated on this issue. Cheers, S.
... View more
07-16-2014
04:06 AM
|
0
|
2
|
3064
|
POST
|
If anybody is interested,I'm putting the ESRI response here. ESRI Reply: The behavior of IWindowPosition::Move is a logged equivalency bug NIM067611, however the bug is still not resolved and is at the "Assigned" status and till date we have no workaround to this/such situations. Cheers, S.
... View more
06-11-2014
06:00 AM
|
0
|
0
|
165
|
POST
|
Hello, Below is my code to move the Toolbar in the ArcMap.
private void DockToolbar(string guidValue)
{
try
{
ICommandBars pCommandBars;
ICommandBar pCommandBar;
pCommandBars = pApps.Document.CommandBars;
UID pUID = new UID();
pUID.Value = guidValue;
pCommandBar = (ICommandBar)pCommandBars.Find(pUID);
if (pCommandBar != null)
{
IWindowPosition windowPos = (IWindowPosition)pCommandBar;
pCommandBar.Dock(esriDockFlags.esriDockShow);
windowPos.Move(1000, 1000);
}
}
catch (Exception ex)
{
//MessageBox.Show(ex.Message);
}
}
After running the code, IWindowPosition.Move does not have any effect on the Toolbar. I found here that this was a bug back in version 10.0. So, I would like to know if this bug has been fixed or not or is there any way to move the Toolbar to the desired location. Basically, we are adding few toolbars to the ArcMap through the custom extension. And when these toolbars are added, either they are floating, on top of of each other or docked that shrinks the ArcMap map area. So, it would be great is know if there is any way to add the toolbars in an organized way. OS : Windows 7 x64 ArcGIS version 10.2.1. Any help is appreciated. Thanks, S.
... View more
06-08-2014
07:24 AM
|
0
|
1
|
731
|
POST
|
Sean, It worked. I took your code and modified it. Appreciate your help. S.
... View more
05-19-2014
04:55 AM
|
0
|
0
|
250
|
POST
|
Sean, Thanks for the reply and the code. The approach looks the same to what I have been trying. I will test this code and put the outcome here. Appreciate your help. Thanks, S.
... View more
05-17-2014
09:00 AM
|
0
|
0
|
250
|
POST
|
Thanks Sean for your help. I tried your suggestion but nothing is happening. I get the zero as the count in ISet as a return type of the IChangeDatabaseVersion::Execute. I am trying to figure out what is happening but no luck so far. Below is my code.
private void ChangeVersionNew(ESRI.ArcGIS.ArcMapUI.IMxDocument pMxDoc, IVersion pOldVersion, IVersion pNewVersion)
{
try
{
IMapAdmin2 pMapAdmin2;
pNewVersion.RefreshVersion();
pMapAdmin2 = pMxDoc.FocusMap as IMapAdmin2;
IChangeDatabaseVersion pChangeDatabaseVersion = new ChangeDatabaseVersionClass();
ISet pSet = pChangeDatabaseVersion.Execute(pOldVersion, pNewVersion, pMxDoc.FocusMap as IBasicMap);
pMapAdmin2.FireChangeVersion(pOldVersion, pNewVersion);
IActiveView pActiveView = pMxDoc.FocusMap as IActiveView;
pActiveView.Refresh();
pMxDoc.UpdateContents();
pNewVersion.RefreshVersion();
return;
}
catch (Exception ex)
{
}
}
Can you please have a look at it and let me know what is wrong with this code please? Appreciate your help. Thanks, Sanjay.
... View more
05-15-2014
06:19 AM
|
0
|
0
|
250
|
POST
|
Hello, I am changing the version in the ArcMap by code and updating the feature classes of all layers/ standalone tables. This way they point to the data on the new version. I have referred the code at this URL : http://edndoc.esri.com/arcobjects/8.3/Samples/ArcMap/Versioning/Change%20Current%20Version%20in%20ArcMap/clsChangeVersionUtil.htm Now everything is fine however the performance is very bad. It is taking a lot of time,10-12 seconds when I do this for the first time. After that, it takes very less time may be 3-4 seconds. I am using ArcGIS 10.2.1. So any help on this issue is highly appreciated. If anybody points me in the right directions for finding the cause behind this, it will be very helpful. It seems that the problematic code is the function, ChangeFeatureLayers() in that code. This method consumes the largest time of the total time. Thanks, S.
... View more
05-13-2014
04:53 AM
|
0
|
5
|
774
|
POST
|
Thavitinaidu, Thanks for your help. I had the same requirement and I could fix it with your suggestion. I am putting my findings here if anyone is interested. The GUIDs of all dockable windows can be found in the registry at the following location. HKEY_CURRENT_USER\Software\ESRI\Desktop10.2\ArcMap\DockingPaneLayouts\panestate\Pane... And the code to remove the dockable window is as below.
IDockableWindowManager docWinMgr = pApps as IDockableWindowManager;
UIDClass pUID = new UIDClass();
pUID.Value = GUIDValue;
IDockableWindow pDocWindow = docWinMgr.GetDockableWindow(pUID);
if (pDocWindow != null)
{
pDocWindow.Show(false);
}
Thanks, S.
... View more
03-19-2014
10:25 PM
|
0
|
0
|
337
|
Title | Kudos | Posted |
---|---|---|
1 | 01-18-2015 10:19 PM | |
2 | 02-03-2015 05:38 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|