Using DesingScript commands in Python Script


#1

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?

Thanks.

이미지 5

 

 


#2

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…)


#3

Hello to all

add to py-script


clr.AddReference(‘DSCoreNodes’)
import DSCore
from DSCore import *


or import specific node category

123


#4

Oh That’s what I wanted. Thanks Ilay.

BTW, where did you get this information???


#5

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

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


#6

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:


#7

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: