POST
|
Is there a way to access the parcel naming tool through arcobjects? It's a great tool, but I want it to point to other columns than the "Name" column in my parcel fabric.
... View more
02-10-2014
11:14 AM
|
0
|
1
|
1834
|
POST
|
I have an existing parcel fabric with data. I would like to load more data from a polygon feature class. I create lines and a topology with the necessary rules. I run the Load a Topology to a Parcel Fabric geoprocessing tool, which succeeds. The polygon records are imported into the parcel fabric, with the name field being populated in this fashion: NameOfFeatureClass_PolygonOID. The records have shape lengths and shape areas of 0, however. Thus, the records exist in the parcel fabric table but there is no shape for the records. Is this a bug with the Load a Topology to the Parcel Fabric geoprocessing tool?
... View more
02-07-2014
10:17 AM
|
0
|
1
|
1143
|
POST
|
I have figured out the answer to this and I thought I would share. You must listen to the IEditEvents2_BeforeStopOperation() event. For the full walkthrough of the workaround, see my post on GIS.Stackexchange: http://gis.stackexchange.com/questions/83167/why-is-my-onchangefeature-event-not-firing-in-my-parcel-fabric-editor-extension
... View more
01-20-2014
01:47 PM
|
0
|
0
|
415
|
POST
|
bumping as there is very little ESRI documentation on parcel fabrics and arcobjects... I'd like to at least have an idea of how edits are saved to the parcel fabric so I can get at the event that is firing here.
... View more
01-17-2014
08:17 AM
|
0
|
0
|
415
|
POST
|
With IDockableWindow, there are two components: The windows form component, and the ESRI IDockableWindow object inside which the windows form is embedded. First, you need to get an instantiation of your ESRI IDockableWindow: public IDockableWindow get_Window(out IDockableWindow dockWindow)
{
UID dockWinID = new UIDClass();
dockWinID.Value = ThisAddIn.IDs.DockableWindow1;
dockWindow = ArcMap.DockableWindowManager.GetDockableWindow(dockWinID);
dockWindow.Caption = "Dockable Window Caption Here";
return dockWindow;
} Now let's say you want to show your dockable window when a button is clicked. Declare your dockable window and call the IDockableWindow.Show() method in your button OnClick event: public ShowDockableWindowButton()
{
}
protected override void OnClick()
{
IDockableWindow dockWindow = get_Window(out dockWindow);
dockWindow.Show(true);
}
... View more
01-17-2014
04:08 AM
|
0
|
0
|
155
|
POST
|
I have an editor extension upon which I would like to listen for events when a parcel fabric attribute table is edited. I have implemented IEditEvents for this purpose: void Events_OnStartEditing() { //Since features of shapefiles, coverages, and so on, cannot be validated, ignore wiring //events for them. if (ArcMap.Editor.EditWorkspace.Type != esriWorkspaceType.esriFileSystemWorkspace) { //Wire OnCreateFeature edit event. Events.OnCreateFeature += new IEditEvents_OnCreateFeatureEventHandler (Events_OnCreateFeature); //Wire onChangeFeature edit event. Events.OnChangeFeature += new IEditEvents_OnChangeFeatureEventHandler (Events_OnChangeFeature); } } However, OnChangeFeature does not fire when editing the attribute table of a parcel fabric. How can I listen for parcel fabric editing events?
... View more
01-16-2014
04:15 AM
|
0
|
3
|
2661
|
POST
|
Conrad87, I'm not sure if you are familiar with or able to use ArcObjects, but an adaptation of this code will do it for you. Note that you don't have necessarily have to use GeometryBags like in the example, since you aren't comparing feature classes to themselves. You just need to be able to access and loop over each feature class. Do it like this: For every polygon in A: For every polygon in B: Calculate distance from A to B (This is done in the linked example using the IProximityOperator.ReturnDistance() method Store distance in an array/list You will want to store your distances in an array/list like in the example, though your data structure may be a bit more complicated because you aren't just looking for the minimum distance like in the example, you need them all to be able to calculate the average. A data structure like this might work: [FeatureIDA, FeatureIDB, distance] Then you simply query all distance from your list that have FeatureIDA in the first element and calculate the average from it.
... View more
09-11-2013
05:44 PM
|
0
|
0
|
822
|
POST
|
Someone answered this for me on another forum. The solution they provided is to use IProjectedCoordinateSystem.CoordinateUnit. I was working with an ILayer, which uses ILayer.AreaOfInterest.SpatialReference. IProjectedCoordinateSystem inherits from SpatialReference, and can be accessed through casting: ESRI.ArcGIS.Geometry.IProjectedCoordinateSystem lyrCoordSystem = (IProjectedCoordinateSystem)pLayer.AreaOfInterest.SpatialReference; lblSpatialReference.Text = lyrCoordSystem.CoordinateUnit.Name;
... View more
04-07-2013
07:57 PM
|
0
|
0
|
225
|
POST
|
Hello, I am developing an ArcGIS desktop addin. I am attempting to get the distance units (ft, mm, km, etc.) from a layer in my .mxd and display it on a windows form. How can I do this? I can access the distance units of a map by using IMap.DistanceUnits, but I have had trouble accessing the distance units of an individual layer.
... View more
04-07-2013
03:33 PM
|
0
|
1
|
679
|
POST
|
Hello Alexander! Thank you for the reply! Your preliminary answer has provided insight. I want to truly understand exactly what is happening in my code, so I'm going to try and get a bit more detailed in explaining where I am not understanding. First off, here are the answers to your questions: First of all, is this an ArcGIS desktop or engine application? It's an ArcGIS desktop application. It is a Windows form in written in C# that opens when you click a button in ArcGIS desktop. Secondly, are you developing an addin or extension code? I am developing an addin. Thirdly, how is the code called from the application? Did you create a command or menu? Is it an event handler? The code is called when you click an "Open" button on the aforementioned Windows form. The purpose of the code is to browse for a shapefile, and once a shapefile is chosen to load the shapefile into the .mxd. The code accesses ESRI's "Add Data" Dialog through the IGxDialog interface and then creates a feature class in the .mxd with which to store the shapefile before loading it. What I drew from your post (correct me if I am wrong) is that I need to use some sort of method (like an OnCreate) to pass in a reference to the map application so that m_application points to the map application. If this is the case, why? Does ArcObjects come in with a "built in" way to reference the current map application? Also, if this is the case, do you have a small snippet of what code like that might look like? Thanks again for your help! Conor
... View more
04-03-2013
08:52 AM
|
0
|
0
|
808
|
POST
|
Hello, I am trying to add a layer to a shapefile. My code is currently very similar to what is provided by ESRI: private void AddShapeFile() { // Create a new ShapefileWorkspaceFactory object and // open a shapefile folder - the path works with standard 9.3 installation IWorkspaceFactory workspaceFactory = new ShapefileWorkspaceFactoryClass(); IFeatureWorkspace featureWorkspace = (IFeatureWorkspace) workspaceFactory.OpenFromFile( "C:\\Program Files\\ArcGIS\\DeveloperKit\\SamplesNET\\data\\Y2000HurricaneData", 0); // Create a new FeatureLayer and assign a shapefile to it IFeatureLayer featureLayer = new FeatureLayerClass(); featureLayer.FeatureClass = featureWorkspace.OpenFeatureClass("2000_hrcn"); ILayer layer = (ILayer)featureLayer; layer.Name = featureLayer.FeatureClass.AliasName; // Add the Layer to the focus map ESRI.ArcGIS.ArcMapUI.IMxDocument mxDocument = (ESRI.ArcGIS.ArcMapUI.IMxDocument)(m_application.Document); IMap map = mxDocument.FocusMap; map.AddLayer(layer); } However, I cannot get the "m_application" reference to work. The instructions provided say that this code "assumes that you already have m_application variable as a reference to the Application object in your .NET custom component". What does this mean? How do I make this reference? Below is my code FWIW. It essentially does the same as above except passes a shapefile chosen from an Add Data dialog that I created from IgxObject. private void btnOpenShapefile_Click(object sender, EventArgs e) { ESRI.ArcGIS.Catalog.IGxObjectFilterCollection pGxFilter; //establish a collection of filters ESRI.ArcGIS.Catalog.GxFilterShapefiles pfilter2; //create a filter Boolean notanythingselected; ESRI.ArcGIS.Catalog.IGxObject gxObj; //declare an instance of GxObjects ESRI.ArcGIS.CatalogUI.IGxDialog pGxDia; //declare an instance of GxDialogs pfilter2 = new ESRI.ArcGIS.Catalog.GxFilterShapefiles(); //create a filter instance pGxDia = new GxDialogClass(); //new dialog box object pGxDia.Title = "Choose a Shapefile"; pGxFilter = (ESRI.ArcGIS.Catalog.IGxObjectFilterCollection)pGxDia; pGxFilter.AddFilter(pfilter2, true); ESRI.ArcGIS.Catalog.IEnumGxObject gxEnum = null; notanythingselected = pGxDia.DoModalOpen(this.Handle.ToInt32(), out gxEnum); if (notanythingselected == false) { return; } else { gxEnum.Reset(); gxObj = gxEnum.Next(); ESRI.ArcGIS.Geodatabase.IWorkspaceFactory wksFact; wksFact = new ShapefileWorkspaceFactory(); ESRI.ArcGIS.Geodatabase.IFeatureWorkspace featWrk; featWrk = (IFeatureWorkspace)wksFact.OpenFromFile(gxObj.Parent.FullName, 0); ESRI.ArcGIS.Geodatabase.IFeatureClass fClass; fClass = featWrk.OpenFeatureClass(gxObj.Name); ESRI.ArcGIS.Carto.IFeatureLayer lyr; lyr = new FeatureLayer(); lyr.FeatureClass = fClass; lyr.Name = gxObj.Name; ESRI.ArcGIS.ArcMapUI.IMxDocument mxDoc = (ESRI.ArcGIS.ArcMapUI.IMxDocument)(m_application.Document); //ERROR IS HERE AT M_application IMap map = mxDoc.FocusMap; map.AddLayer(lyr); I hope this has a super simple answer. I'm pretty new at this 🙂
... View more
04-02-2013
04:42 PM
|
0
|
4
|
3226
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|