Select to view content in your preferred language

Need to retrieve parcel properties

709
2
11-20-2013 08:44 AM
StevenMumby
Deactivated User
Hi guys

I need to get properties associated with a parcel in ArcMaps once the GIS technician clicks it.  I've got the event handlers set up, references to IMAPS and IMAP, but not sure which class will contain things like the parcel ID.  Any suggestions where I might find this?

Tks
0 Kudos
2 Replies
SteveFang
Deactivated User
I assume you are developing an Add-In tool in ArcMap.  The following are some high level steps you probably want to do.

1) From your IMap you can get the parcel layer in TOC by index or enumeration.  Find the layer and cast it to IFeaturelayer.
2) IFeaturelayer has a mehtod called Search which you will need later.
3) You tool has a mouse down event which has parameter of XY (this is the screen display XY).
4) Inside the mouse down event handler you will need to transform XY to map XY.  Look at IScreenDisplay, you can get there using your map document's ActiveView property.
5) With map XY, you will be able to create a point geometry.
6) Use this point in a ISpatialfiler.
7) Pass ISpatialfilter into the Search method from step 2 to get a Feature cursor.
😎 Cycle thourgh the feature cursor because there could be 0 to many polygons selected.
9) Find value of the feature by passing in index of the field you're looking for.
10) Use the value as you wish to display to GIS Technician.
0 Kudos
StevenMumby
Deactivated User
Hi

I don't know if I'd call this an add-in tool.  I've created a new project from the ArcGIS Desktop Class Library(ArcMap) template.  This project template extends from BaseMenu. The user launches my app from the menu which opens a winForm.  Inside the winForm they need to manually complete some fields like address street number.  Other fields in the winForm will be populated based on parcel attributes the user will select from ArcMap.  I believe I understand most of your instructions, but where I get hung up is on the mouseDown event.  I need to add code to my winForm to listen for mouseDown events in the ArcMap document.  Once I've handled that event, it should be a relatively simple matter of figuring out which parcel the user has selected so I can retrieve those attributes and pass those back to my winForm.

Does that make sense?

Tks for the assistance.
0 Kudos