How can you get a Dynamo Dictionary out of a Python Node?
This will import the dictionary libraries.
import clr clr.AddReference('DesignScriptBuiltin') from DesignScript import * OUT = Builtin.Dictionary.ByKeysValues(["S"],)
But to get the nested lists and all that to work would require more effort and probably sample files that represent your list structure, etc… It would also require someone who knows Python better than me.
Hello an example
another way is to create a custom object from element (instance of a Python Class)
class MyCustomDataElement(): def __init__(self, elem): self.connectors = #....... self.mepSystems = #....... self.location = #.......
Really handy. I have a question: will the “custom class” works also outside the python block? I mean, don’t it will passed to Dynamo as “ironpython.something” ?
a small example with a cable Tray
To be purist, attributes should be passed into properties