Hi
I would like to ask if there are some changes in Python in Dynamo 0.8 and 0.9 compared to 0.75.
I have a script which worked just fine in 0.75 but doesn’t work in 0.8 and 0.9
Hi
I would like to ask if there are some changes in Python in Dynamo 0.8 and 0.9 compared to 0.75.
I have a script which worked just fine in 0.75 but doesn’t work in 0.8 and 0.9
Couple of things:
Check those out.
Technically UnwrapElement does work on lists but with one major drawback - the output is not a python list object. It says it’s a list but it behaves as a tuple:
If I try to append something, l2 fails:
Thank you both for your suggestions. Are there any changes in the API though? I still can’t make it run. I am trying to join multiple objects to a single one.
join join
When I said that you can’t unwrap a list of elements like that i didn’t mean that you don’t have to unwrap them at all. you do. just iterate through the list:
if isinstance(IN[0], list):
unwrappedList = [UnwrapElement(i) for i in IN[0] ]
else:
unwrappedList = [UnwrapElement(IN[0])]
that’s for a flat list. if you have a nested list of elements, you would need a function and then map over it.
Dimitar,
Yes, that’s what I meant. It unwraps the whole thing into a single object that is not a Python list.
Thanks.
I’ll give it a try. I’m pretty sure though that previously I’ve used this same piece of Python script successfully using lists as imports.