POST
|
I think that the SDK is version-specific. You're "runtime" is ArcMap/ArcGIS Desktop and you are using different versions: ArcObjects SDK is 10.4, ArcMap is 10.5. This is not a supported scenario in my opinion (see also: https://community.esri.com/thread/161071 ) so I guess this is also the reason for the error message. Try to install the SDK-version that matches you're ArcMap-version.
... View more
08-19-2018
11:47 PM
|
1
|
1
|
580
|
POST
|
Hi, I had a similar problem, but I can't remember the concrete error message. The reason was that I updated the ArcObjects-SDK by uninstall/install but I did not update the ArcGis runtime - these are 2 separated items in windows control panel. After updating the runtime my development machine and I were happy ... Maybe you have the same problem.
... View more
08-18-2018
04:08 AM
|
0
|
3
|
580
|
POST
|
Hello Jose, I'm no vb.net-guru but I think casting in vb.net is done by using DirectCast/TryCast: 1. if you're sure that casting will succeed (otherwise it throws an exception so use an exception handler) use DirectCast: Dim pFWsp as IFeatureWorkspace= DirectCast(mySdeWorkspace, IFeatureWorkspace)
Dim pFClass as IFeatureClass = pFWsp.OpenFeatureClass(name)
2. if you're not sure - use TryCast Dim pFWsp as IFeatureWorkspace= TryCast(mySdeWorkspace, IFeatureWorkspace)
if pFWsp IsNot Nothing then
Dim pFClass as IFeatureClass = pFWsp.OpenFeatureClass(name)
...
End if
... View more
08-18-2018
03:57 AM
|
0
|
0
|
1067
|
POST
|
Hi, first you should open your sde-workspace and then cast this workspace to IFeatureWorkspace to open your feature class. 1.) open Workspace: (Connecting to a workspace using IPropertySet ) public IWorkspace open_ArcSDE_Workspace(string server, string instance, string user,
string password, string database, string version)
{
ESRI.ArcGIS.esriSystem.IPropertySet propertySet = new ESRI.ArcGIS.esriSystem.PropertySetClass();
propertySet.SetProperty("SERVER", server);
propertySet.SetProperty("INSTANCE", instance);
propertySet.SetProperty("DATABASE", database);
propertySet.SetProperty("USER", user);
propertySet.SetProperty("PASSWORD", password);
propertySet.SetProperty("VERSION", version);
IWorkspaceFactory workspaceFactory = new ESRI.ArcGIS.DataSourcesGDB.SdeWorkspaceFactoryClass();
return workspaceFactory.Open(propertySet, 0);
} 2.) open feature class IFeatureClass pFClass = ((IFeatureWorkspace)mySdeWorkspace).OpenFeatureClass(name);
... View more
08-17-2018
06:39 AM
|
0
|
2
|
1067
|
POST
|
Hi Marcelo, try this:
public void StopEditing(bool saveChanges)
{
//Get a reference to the editor.
UID uid = new UIDClass();
uid.Value = "esriEditor.Editor";
IEditor editor = m_application.FindExtensionByCLSID(uid)as IEditor;
//Check to see if a workspace is already being edited.
if (editor.EditState != esriEditState.esriStateNotEditing)
{
editor.StopEditing(saveChanges);
}
}
have a look at the editing-API: ArcObjects Help for .NET developers Frank
... View more
10-21-2014
11:36 PM
|
0
|
1
|
304
|
POST
|
Hi Jin, 2 possible reasons: * you need the 32 bit version of the oracle-client * or: it is the correct platform but the wrong oracle-version (e.g. 12 instead of 10 or 11). Compare this to your client-machine. You can have several oracle-clients in parallel on your system, important is to check the one that is found first by the PATH-setting_ Open a cmd window and type: sqlplus you will see an version-information for the oracle-client. Compare this infos between the two machines. Hope this helps Frank
... View more
10-07-2014
05:04 AM
|
0
|
1
|
1264
|
POST
|
Hi Jin, have you tried to compile your app as x86 and started this on your server ? This will be started as 32-bit process on the 64-bit machine and you have to use a 32-bit-process if you use ArcObjects (see this link - I'm not aware of any changes in this: Developing with ArcObjects on Windows 64-bit OS | jeff germain's blog ). But maybe I didn't fully understand your setting. Frank
... View more
10-07-2014
02:50 AM
|
0
|
3
|
1264
|
POST
|
Hi, I think this is caused by the selected platform of your VS-project respectively the project of the process loading your dll. ArcObjects uses 32-bit COM objects, so if you use "Any cpu" on a 32-bit machine this means 32-bit. On a 64-bit machine this will be 64-bit - and that's you're problem. Make sure, that the process loading your dll is a 32-bit process - compile it with the platform target 'x86'. Frank
... View more
10-06-2014
11:58 PM
|
0
|
5
|
1264
|
POST
|
hm, difficult to diagnose by this small snippet. I guess the second call is caused by the code we do not see here. Maybe it's an (mouse-)event-handler that is triggered accidentally or something like that. You should be able to diagnose this by: 1. add an else-statement to handle cancel and close 2. place a breakpoint here 3. run your plugin in debug-mode 4. use your plugin and cancel the file selection -> you should reach your breapoint 5. check the call-stack - this should be the normal program flow 6. continue execution 7. maybe the debugger stops again - now check the callstack: who calls your function If you can not reproduce your error this way this could be caused by the first debugger break. Try something like this (sorry - c#):
private bool _alreadyCanceled = false;
private void button1_Click(object sender, EventArgs e)
{
var ofd = new OpenFileDialog();
ofd.Filter = @"Comma delimited|*.csv";
ofd.Title = @"Open a Test";
if(ofd.ShowDialog() == DialogResult.OK)
{
var test = ofd.FileName;
Debug.WriteLine(string.Format("Filename: {0}",test));
}
else
{
if(_alreadyCanceled)
{
int i = 1; //place your breakpoint here - who is calling ?
}
_alreadyCanceled = true;
}
}
... View more
09-21-2014
11:50 PM
|
0
|
2
|
520
|
POST
|
Hi Li, "normally" this code should work under an WinForms-environment. But: you'd better check the result of the function ShowDialog - you should only work with the value of FileName if ShowDialog returns DialogResult.OK. Frank
... View more
09-21-2014
10:52 PM
|
0
|
4
|
520
|
POST
|
Hi Li, I didn't checked it by myself but I think the following should work: the editor implements the interface IEditLayers which contains the property CurrentLayer. This is the layer the user selected to add the new feature: Dim uid As UID uid = New UIDClass() uid.Value = "esriEditor.Editor" Dim editor As IEditor editor = CType(m_application.FindExtensionByCLSID(uid), IEditor) Dim editLayers as IEditLayers editLayers = CType(editor, IEditLayers) Dim layer as ILayer layer = editLayers.CurrentLayer et voila .... Frank
... View more
09-16-2014
12:16 AM
|
1
|
1
|
188
|
POST
|
Hi Li, no problem. In the event-handler OnCreateFeature you receive the parameter "obj" of type IObject. IFeature inherites from IObject - in this case the parameter obj is an IFeature so that you can cast obj to IFeature and use the code above to check the GeometryType. I'm no vb-crack but I guess it should look like this (at least similar): Private Sub OnCreateFeature(ByVal obj As ESRI.ArcGIS.Geodatabase.IObject)
Dim feature as IFeature
feature = DirectCast(obj, IFeature)
if feature.Shape.GeometryType = ESRI.ArcGIS.Geometry.esriGeometryType.esriGeometryPolygon then
'do something with a polygonfeature
else etc.
...
End Sub regards Frank
... View more
09-15-2014
03:52 AM
|
1
|
4
|
807
|
POST
|
Hi, so you're looking for a way to run code each time a new feature is created in an edit-session ? This can be done by using Editor-events (see "ArcGIS Desktop editing for developers" in the online help): the editor object that handles editing tasks in ArcMap owns an event "OnCreateFeature" where you can react on new features inserted by the user. I hope this helps you and meets your needs. Otherwise please give some more informations about the workflow you want to support. Frank
... View more
09-15-2014
01:18 AM
|
0
|
7
|
807
|
POST
|
Sorry - "CreateFeatureOfUnknownType" is no existing function, it's a placeholder in this example for the function you are using to create your feature.
... View more
09-15-2014
12:12 AM
|
0
|
9
|
807
|
POST
|
Hi, you could check the GeometryType of the Shape-property of IFeature: IFeature feature = CreateFeatureOfUnknownType(); //do some null-checks here //then switch(feature.Shape.GeometryType) { case ESRI.ArcGIS.Geometry.esriGeometryType.esriGeometryPolygon: //blah break; case ESRI.ArcGIS.Geometry.esriGeometryType.esriGeometryPolyline: //blahblah break; //etc }
... View more
09-15-2014
12:01 AM
|
0
|
11
|
807
|
Title | Kudos | Posted |
---|---|---|
1 | 08-19-2018 11:47 PM | |
1 | 09-16-2014 12:16 AM | |
1 | 09-15-2014 03:52 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|