Python userDictionary example


#1

I can’t seem to find an example of how to set key, value pairs in the UserDictionary. Are there any?

Thanks,

Nathan


(Dale Fugier) #2

http://www.dotnetperls.com/dictionary-python


#3

Ok, thanks to to this thread:

I got the hint I needed. This python way:

rObjectGeo.UserDictionary[‘key’] = ‘value’

Doesn’t seem to work for me. However this way:

rObjectGeo.UserDictionary.Set(‘key’, ‘value’)

Does.


(Steve Baer) #4

We may be able to eventually support the syntax of

rObjectGeo.UserDictionary['key'] = 'value'

but it is going to take a bit of work and most likely won’t be available until V6. The UserDictionary has a large number of overloaded Set functions in order to only allow certain types to be added to the dictionary.


#5

No problem with the way it is as long as you know that is the only way it works!