4

This link illustrates one method for calling python scripts from within an ArcObjects environment. The results of these tasks are returned as strings. I wonder if it is possible to call a python script and pass objects back and forth.

For example, assume I have defined a 2-dimensional array (in VB.Net) of x,y coordinate pairs. I want to pass this object to a .py script that will perform some computation (doesn't matter what really) and return a dictionary of lists, i.e. {"1":[2,3,4], "2":[1,3,4], "8":[9,11,5]}.

asked May 21, 2013 at 18:29

1 Answer 1

4

As far as I know, there is no way to pass objects between .net and python, but you can use a common data structure like JSON to pass data in string form back and forth and restructure using something like JSON.NET which has a method of deserializing the raw JSON string into a dictionary. It should be easy to find a library that does this on the python end as well. Here's a usage example.

answered May 21, 2013 at 18:43

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.