POST
|
The geoprocessor object is a bit slow but lets you do this by writing very little code. Try passing your joined feature class into the example below. The alternative is to roll your own export routine that would copy the data line by line to the necessary format. The more general it needs to be the more code you need to write, but isn't that always the case 🙂 private bool CreateFC(IFeatureClass featureClass)
{
//THIS CREATES THE AN EMPTY FEATURE CLASS WITH ALL NEEDED FIELDS IN THE TEMP FWS
IFeatureWorkspace TempFWS = CreateFWS(); //Create the feature workspace that you need, lots of examples online
if(TempFWS == null) return false;
TempFWS.CreateFeatureClass("YourFcName", featureClass.Fields, null, null, esriFeatureType.esriFTSimple, featureClass.ShapeFieldName, "");
//THIS POPULATES THE FC WITH ALL THE FEATURES
Geoprocessor gp = new Geoprocessor(); //starts a GEOprocess.
gp.SetEnvironmentValue("workspace", "<path + geodb name>"); //sets the geodb to use (ex. C:\GIS\temp.mdb)
gp.AddOutputsToMap = false;
ESRI.ArcGIS.DataManagementTools.Append append = new ESRI.ArcGIS.DataManagementTools.Append(); //this tool uploads the feature class
append.inputs = featureClass;
append.target = "Path + geodb name + layer name";
// example: System.IO.Path.GetTempPath() + @"\" + temp.mdb + @"\" + LayerName;
try
{
gp.Execute(append, null);
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
return false;
}
return true;
}
... View more
10-10-2012
01:44 PM
|
0
|
0
|
189
|
POST
|
The IMemoryRelationshipClassFactory object you create is not an actual feature class but an in memory join that points to the source datasets. Since you are pulling data from an SDE the .mxd can not find the source. You can manually save the layer by right-clicking it and choosing Data > Export Data and then save as a feature class on disk. Or write some code to export it to disk.
... View more
10-10-2012
01:16 PM
|
0
|
0
|
189
|
POST
|
This behavior does not occur in 10.0 SP3. I really hope they haven't changed the deployment model in later versions. Do you update the Config.esriaddinx file to a new version number when you make updates? I believe the local Add-In will be overwritten only when the network Add-In has a different version number.
... View more
10-09-2012
03:47 PM
|
0
|
0
|
256
|
POST
|
When creating COM tools for prior releases of ArcMap I would maintain a copy of the .NET reference folder on my dev machine for other 9.x versions . Then in Visual Studio go to the project properties page and under Reference Paths choose the folder of the references you want to use. I have not tried this is 10.x but I suspect that combined with the above workaround it would work. In 10.0 the default location of the ArcObjects references is: C:\Program Files (x86)\ArcGIS\DeveloperKit10.0\DotNet This assumes you are properly licensed for each version you compile for.
... View more
08-29-2012
10:13 AM
|
0
|
0
|
946
|
POST
|
This function works for me: private static stdole.IFontDisp GetFont(string fontName) { stdole.IFontDisp dispFont = (stdole.IFontDisp)new stdole.StdFont(); dispFont.Name = fontName; return dispFont; } Be sure to add a reference to stdole.dll to your project.
... View more
07-17-2012
11:02 AM
|
0
|
0
|
674
|
POST
|
Sui- I noticed you have never accepted an answer to your posted questions. I'm not in the hunt for any point awards, but I'm sure there are many here who would appreciate some recognition for using their valuable time to help you.
... View more
07-10-2012
12:22 PM
|
0
|
0
|
276
|
POST
|
What are the costs / licensing requirements to deploy a WPF Runtime application?
... View more
07-10-2012
12:12 PM
|
0
|
0
|
701
|
POST
|
So is it working ok now? You seem to be doing it right. Use the template to build the ITool, then hide it from the toolbar. Because it is a COM tool you can access it by the GUID. It doesn't need to be re-registered at runtime. It gets registered when it is installed. Then it is available to you when ArcMap starts via the GUID.
... View more
06-21-2012
10:45 AM
|
0
|
0
|
446
|
POST
|
Are you using Visual Studio? There are templates in VS to create custom tools for ArcMap. You can create them as COM extensions (need an installer to deploy) or using the newer Add-in framework. I recommend the Add-in method because it makes deployment much easier. It looks like your code is attempting to use the COM method. There is a lot more to it than what you have and yes it has to be registered. Do you have the template?
... View more
06-20-2012
11:00 AM
|
0
|
0
|
446
|
POST
|
That really depends on what you are trying to do. Are you trying to return information from a feature clicked in the map? Trying to pop up a context menu when user right-clicks? It's all different. Please define what you are trying to acheive. A typical scenario is the need to capture the location when a user left-click the map. To accomplish this I create a ITool that the user activates prior to clicking. The ITool provides event handlers such as OnMouseUp that you can add code to.
... View more
06-19-2012
02:01 PM
|
0
|
0
|
1219
|
POST
|
Are you using ArcEngine? I assumed you were since you were trying to use the IMapControl. That interface is for accessing the map of an ArcEngine control.
... View more
06-19-2012
12:01 PM
|
0
|
0
|
1219
|
POST
|
Sui- I don't think you want to get a reference to your IMapControl2 object using the new keyword. I think you need to query interface from an existing object. Something like this:
IMapControl4 mapControl = axMapControl1.Object as IMapControl4;
Do you have an axMapControl1 object somewhere?
... View more
06-19-2012
10:35 AM
|
0
|
0
|
1219
|
POST
|
In your geometry bridge code you create a new testBridge object but don't add any geometries to it. So when you try to use ReplacePoints method there are no points to replace.
... View more
06-12-2012
12:14 PM
|
0
|
0
|
870
|
POST
|
I would have put the zaware code before you set the z value of TestPoint
... View more
06-12-2012
11:34 AM
|
0
|
0
|
870
|
POST
|
You need to cast your TestPoint to the IZAware interface and set the ZAware property = true Something like this should work: IZAware zAware = TestPoint as IZAware;
zAware.ZAware = true;
... View more
06-12-2012
10:31 AM
|
0
|
0
|
870
|
Title | Kudos | Posted |
---|---|---|
1 | 04-17-2013 02:17 PM |
Online Status |
Offline
|
Date Last Visited |
yesterday
|