Select to view content in your preferred language

Python add-in - get list of selected features in order selected

6217
10
05-06-2014 09:18 AM
Zeke
by
Honored Contributor
I'm trying to create a python addin that will fill a list with the objectids of features in the order they're selected. This is so I can then add incremental numbers to them in that order. Trying to automate lot numbering, basically. The order of the objectids themselves doesn't necessarily correspond to lot order, so can't just sort them. The idea is that the user would select the features, then click a button to add the lot numbers.

I can add numbers using Chris Fox's UniqueIDSort script, but there's no existing field to sort on. Main problem is retrieving the objectid when the script hasn't run yet. Tried using onEditorSelectioChanged() under Extensions, which presumably could just listen for the event and build the list, but don't see documentation on how to check if a feature has been selected or unselected. Any help much appreciated.
Tags (2)
0 Kudos
10 Replies
JoyC
by
Emerging Contributor

Hi Wayne,

I wonder what's your status on this issue. I know it's been a while since your last posting, but would still like to know if you ever got a solution. I'm in the exact situation as you were, need to upgrade a customized tool developed by someone years ago. Yet we are not ready to use parcel fabric.

0 Kudos