Using DesingScript commands in Python Script

Some of nodes work in Python Script node as they work at Code Block, but some don’t. Can anyone explain about it for me? Are there something more to be imported to python?


이미지 5



1 Like

I would agree that it would be nice to have a list of libraries that can be referenced.

For that particular command you may as well use the Python equivalent: set(mylist) …

(Although that will not work for all data types…)

Hello to all

add to py-script

import DSCore
from DSCore import *

or import specific node category


Oh That’s what I wanted. Thanks Ilay.

BTW, where did you get this information???

Sources and description of DSCore in DSCoreNodes.xml(DSCore.List.UniqueItems)

also, over forum , somebody shows how to import from revit nodes.

Thanks again Ilay.

I wish Autodesk gave us more information about using Python on Dynamo in kind and organized form. It’s hard to search for now. And yet Dynamo is awesome. :slight_smile:

what about GroupByFunction, I cant find that in DSCoreNodes.xml, and I need this for grouping a sublist according to a dynamo function (Family.Name), list is walls comming from all elements at level. I want to keep the list sorted in levels and in next list level (3d) grouped by family name.

Inside Dynamo, this works in a codeblock “GroupByFunction(item[0],func);”, but looping in dynamo (and codeblocks) is a nightmare, so I am using Python for all that needs loops. Python is well documented DesignScript is not, Stackoverflow gives excellent ideas for Python, no one knows DesignScript. So I only use DesignScript for very simple procedures, looping is not one of them :slight_smile: