Extract python code from packages


I currently use a node from rhythm in my dynamo script, but it is supposed to be used by many others, and I would like to not help them install packages:) Is there anyway to get the python code used in a rhythm node and then put this code in a code-block instead?

Double click on the node to open the .dyf. From there you can access the python node by double clicking.

You can edit the node as directed above to move the contents into a project, but the Python won’t be formatted to use in a code block, only a Python node.

The node might also not function the way you want if you’re using lacing. You would need to edit the code in some cases.

1 Like

Thanks a lot for all answers! May I ask what is lacing?

Lacing relates to how lists are managed within a function. I suggest checking out the Primer.


@jorgen.fidjeland- May I ask what node it is you are using? :grinning:

1 Like

Sure, it is the pick model element node. Thanks for making this available, awesome work!

It works fine, except I still struggle with understanding how to “toggle” it so that it will go to revit for picking every time the script is run, as you have already tried to explain to me in this tread: Select Elements on Screen - Fill out Parameter

Of course, glad to hear that it is useful!

To pull that python code out it will look like this in your graph.

The toggle simply provides an option to reset the selection in the same Dynamo session. By default it will reset every time you open the graph.

1 Like