Hi,
I am used to Python scripting in Rhino and Grasshopper through Rhinoscript Syntax.
I am getting into Python in Dynamo and seem to be running into issues with basic Python syntax.
Essentially, I have a list of FamilyInstances from a Panelized DividedSurface as an input.
Using a list of each panel’s Z coordinate as a Key, I sorted the list of Panels in ascending order.
The SortByKey in Dynamo returns both the sorted Key List and the sorted Data List as lists within themselves, thus the output of the node is a list of 2 lists.
In the below image, the Watch node displays the 2 lists after sorting.
I would like to output just the sorted family instances, so I thought square brackets would do the trick:
OUT=newPanels[0]
but it doesnt and I don’t know why.
Any ideas?
I get the error message:
Warning: IronPythonEvaluator.EvaluateIronPythonScript operation failed.
Traceback (most recent call last):
File “”, line 43, in
KeyError: The given key was not present in the dictionary.
Here is my Python Node. The lines in question are at the bottom.