|
POST
|
In my C# console application I tried using the below line of code to declare a IFeatureClassName object but Visual Studio 2010 says that FeatureClassNameClass() has No Constructors defined. What?? IFeatureClassName pOutFeatClassName = (IFeatureClassName)new FeatureClassNameClass(); Also If I changed my code to the below line of code Visual Studio will not show any errors on the syntax but when I start debugging my application and I reach this line, Visual Studio throws a crazy error stating something like "error on vshost32.. and just stops debugging IFeatureClassName pOutFeatClassName = (IFeatureClassName)new FeatureClassName(); Does anyone have any suggestions for me? Thanks
... View more
02-03-2011
06:56 AM
|
0
|
7
|
2811
|
|
POST
|
Hello All- I'm creating a C# Standalone application and I have initialized ArcObjects. Whenever I need to update or add records to a featureclass or table I'm getting an error at pRow.set_Value below stating "Object does not contain a definition for 'set_Value'"... Now in Visual Studio when I'm writing the code pRow does have set_Value when I type a "." after it. I'm so confused here.. pRow.set_Value((int)l_FCWellID, pRow.get_Value((int)l_WellID));
Please add any thoughts if you have any. Many thanks
... View more
01-24-2011
09:39 AM
|
0
|
2
|
668
|
|
POST
|
I ended up using an arcpy script to get this to finally work. So in short I never figured out why I couldn't use the IRow method above.
... View more
01-17-2011
11:34 AM
|
0
|
0
|
1075
|
|
POST
|
Is the feature that you are creating a custom feature class? If so then did you register it using ESRIRegAsm? I am just trying to think of things that changed between 9.3.1 and 10. Hi Richard- I'm creating a Table inside of a Personal Geodatabase. I create the columns using the code below and the columns do get created but I notice I use ESRI.ArcGIS.Geodatabase.Field(); instead of ESRI.ArcGIS.Geodatabase.FieldClass(); That puzzles me. Whenever I try to use FieldClass() I get a "FieldClass cannot be embedded, use applicable interface instead." So instead of using FieldClass I use Field and the fields still get created but whenever I loop through the newly created table I'm not able to add data to a particular row as I first stated. The error thrown is "object does not contain definition for 'set_value' Thoughts? ESRI.ArcGIS.Geodatabase.IObjectClassDescription objectClassDescription = new ESRI.ArcGIS.Geodatabase.ObjectClassDescription(); ESRI.ArcGIS.Geodatabase.IField pField; IFieldEdit pFieldEdit; IFields pFields = objectClassDescription.RequiredFields;//new Fields(); IFieldsEdit pFieldsEdit = (ESRI.ArcGIS.Geodatabase.IFieldsEdit)pFields; pField = new ESRI.ArcGIS.Geodatabase.Field(); pFieldsEdit.FieldCount_2 = 62; pField = new Field(); pFieldEdit = (ESRI.ArcGIS.Geodatabase.IFieldEdit)pField; pFieldEdit.Name_2 = "Well_ID"; pFieldEdit.Type_2 = esriFieldType.esriFieldTypeString; pFieldEdit.Length_2 = 15; pFieldsEdit.set_Field(0, pField); .....
... View more
01-17-2011
08:28 AM
|
0
|
0
|
1075
|
|
POST
|
Standalone programs in version 10 have to do some additional work before calling ArcObjects: http://blogs.esri.com/Dev/blogs/arcgisdesktop/archive/2010/07/19/Bind-and-License-your-standalone-ArcGIS-Engine-or-Desktop-application.aspx I haven't a clue whether or not this relates to your problem. Just trying to help by throwing out ideas. Update. Here is a better link which describes the set of additional things that you need to do in version 10: http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/What_s_new_for_developers_at_10/0001000002zp000000/ Hi Richard- Thank you for the response. I don't think that is the problem I am experiencing as I already initialize the license in my Main with the below code before I ever utilize any ArcObjects. Thoughts? if (!ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.EngineOrDesktop))
{
MessageBox.Show("Unable to bind to ArcGIS runtime. Application will be shut down.");
return;
}
else
{
IAoInitialize ao = new AoInitialize();
ao.Initialize(esriLicenseProductCode.esriLicenseProductCodeArcInfo);
}
... View more
01-17-2011
06:34 AM
|
0
|
0
|
1075
|
|
POST
|
Does anyone have any good suggestions? If I haven't provided enough information or you have any suggestions then please let me know. Many Thanks
... View more
01-16-2011
05:02 PM
|
0
|
0
|
1075
|
|
POST
|
This isn't making much sense to me so I'm hoping somebody here can help. I have a C# standalone console app that uses ArcObjects to add data into a newly created Feature Class. Below is part of my code and it worked great on a Windows XP 64-bit machine that was running ArcGIS 9.3.1. Now I have moved my application over to a Windows 2008 Server running ArcGIS 10 SP1 and I'm getting an error at pNewRow.set_Value((int)l_FCWellID, pRow.get_Value((int)l_WellID)); It just states that "object does not contain a definition for "set_Value"" I don't get it because when I check the methods, pNewRow clearly has .set_Value as an option. And Yes each parameter in set_Value in the loop below does have an actual value at runtime. Does anyone have some advice for me? Thank you in advance.. IRow pNewRow;
do
{
pNewRow = pNewTable.CreateRow();
pNewRow.set_Value((int)l_FCWellID, pRow.get_Value((int)l_WellID));
pNewRow.set_Value((int)l_FCWellAlias, pRow.get_Value((int)l_WellAlias));
pNewRow.set_Value((int)l_FCWellName, pRow.get_Value((int)l_WellName));
pNewRow.set_Value((int)l_FCAPI, pRow.get_Value((int)l_API));
pNewRow.set_Value((int)l_FCOPERATOR, pRow.get_Value((int)l_OPERATOR));
pNewRow.set_Value((int)l_FCTEAM, pRow.get_Value((int)l_TEAM));
pNewRow.Store();
pRow = pTableCursor.NextRow();
} while (pRow != null);
... View more
01-14-2011
09:39 AM
|
0
|
6
|
1367
|
|
POST
|
Hello, My below code is erroring on the last line. I can run this ImportMetadata tool in ArcMap but when I export it to a python script I'm getting this error. Why?? stating something like Traceback: File "C:\scripts\Metadata_Importer.py", line 362 arcpy.ImportMetadata_conversion(Laterals_xml, "FROM_ISO_19139" sde_DEVGIS_Laterals, "DISABLED") File "E:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\conversion.py", line 441, in ImportMetadata raise e arcgisscripting.ExecuteError: Failed to execute. Parameters are not valid. Error 000816: he tool is not valid. Failed to execute (ImportMetadata). The code is: # Import arcpy module
import arcpy
# Local variables:
Laterals_xml = "K:\\GISTeam\\Data Services\\GIS Data\\Metadata\\Laterals.xml"
sde_DEVGIS_Laterals__2_ = "Database Connections\\SQL10 (devgis - sde).sde\\sde.DEVGIS.DevDirectionalSurvey\\sde.DEVGIS.Laterals"
# Process: Import Metadata
arcpy.ImportMetadata_conversion(Laterals_xml, "FROM_ISO_19139", sde_DEVGIS_Laterals__2_, "DISABLED")
... View more
01-13-2011
10:19 AM
|
0
|
3
|
2983
|
|
POST
|
Thank you both Alexander and Jeff. I think you got me going on the right track.
... View more
01-12-2011
12:19 PM
|
0
|
0
|
622
|
|
POST
|
Have you updated all the project references to be version independent and to replace some of the changed ones to the ArcGIS 10 references? I notice you use the full namespace reference to the library in interface name for the declaration but not for the class name in the constructor, did you declare using on the namespace for the class, are there warnings on these using statements? Hi Alexander- All I have really done once I copied over the C# project was to remove all references and then re added them back thinking that would fix the problem. I also added a reference to ESRI.ArcGIS.Version. So can you explain a few steps about what you mean? Many thanks Alexander..
... View more
01-12-2011
09:50 AM
|
0
|
0
|
622
|
|
POST
|
Hello- I had written a rather long C# standalone console app that worked fine on a Windows XP machine running ArcGIS 9.3.1. I copied this over to a Windows 2008 Server that is running ArcGIS 10 (along with Visual Studio 2010) and every single place I have the "new" keyword I'm getting a "Has No constructors defined error.." See example below. What can I do to fix this?? many thanks ESRI.ArcGIS.esriSystem.IPropertySet pInPropSet;
pInPropSet = new PropertySetClass(); //The error is highlighting new PropertySetClass()
... View more
01-12-2011
09:09 AM
|
0
|
4
|
4461
|
|
POST
|
Hi Luke- I used VarArrayClass and then ran my code again but still got the same error. I'll keep trying. This is Strange..
... View more
01-12-2011
03:58 AM
|
0
|
0
|
652
|
|
POST
|
I'm finding that even though the resource center indicates that calling the tool the way you're doing that below ESRI.ArcGIS.ConversionTools.MetadataImporter MI = new MetadataImporter(); has yet to work for me. I have had success when I call the tool by string as the first parameter of the Execute method... an example from one of my projects: IVariantArray parameters = new VarArrayClass();
parameters.Add(inFC);
//parameters.Add(outFC);
parameters.Add(outworkspace);
parameters.Add(outshapefile);
parameters.Add(" ");
//parameters.Add("NO_TEST");
parameters.Add(fieldmapping);
...
object severity = 2;
try
{
//if(!gp.Exists(outshapefile))
gp.Execute("FeatureclassToFeatureclass_conversion", parameters, null);
//gp.Execute("append_management", parameters, null);
fieldmapping.RemoveAll();
}
catch
{
Console.WriteLine(gp.GetMessages(ref severity).ToString());
} so I'm guessing you're going to want to set it up something like this: ESRI.ArcGIS.Geoprocessor.Geoprocessor gp = new ESRI.ArcGIS.Geoprocessor.Geoprocessor();
gp.OverwriteOutput = true;
IVariantArray parameters = new IVariantArrayClass();
parameters.Add("K:\\GISTeam\\Data Services\\GIS Data\\Metadata\\PilotsFieldsUnits.xml");
parameters.Add("Database Connections\\SERVER-SQLPRD10 (devgis - sde).sde\\sde.DEVGIS.DevelopmentAndTesting\\sde.DEVGIS.PilotsFieldsUnits");
gp.Execute("MetadataImporter_conversion", parameters, null);
good luck, I hope this helps Hi Luke- Thanks for the fast reply. I'm having a little trouble locating the IVariantArrayClass. I found IVariantArray as part of the esriSystem reference. Thoughts?
... View more
01-12-2011
03:53 AM
|
0
|
0
|
652
|
|
POST
|
I'm using ArcGIS 10 and my script is just a C# standalone console app. In using the below code, it bombs on the gp.Execute line suggesting "Error HRESULT E_FAIL has been returned from a call to a COM component". The Source path and the Target path appear to be correct. Ideas anyone?? Thanks ESRI.ArcGIS.Geoprocessor.Geoprocessor gp = new ESRI.ArcGIS.Geoprocessor.Geoprocessor();
gp.OverwriteOutput = true;
ESRI.ArcGIS.ConversionTools.MetadataImporter MI = new MetadataImporter();
MI.source = "K:\\GISTeam\\Data Services\\GIS Data\\Metadata\\PilotsFieldsUnits.xml";
MI.target = "Database Connections\\SERVER-SQLPRD10 (devgis - sde).sde\\sde.DEVGIS.DevelopmentAndTesting\\sde.DEVGIS.PilotsFieldsUnits";
gp.Execute(MI, null);
... View more
01-12-2011
03:24 AM
|
0
|
5
|
2587
|
| 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
|