# Extract python code from packages

**URL:** <https://forum.dynamobim.com/t/extract-python-code-from-packages/15549>\
**Category:** FAQ\
**Created:** [October 11, 2017, 11:36am UTC](https://forum.dynamobim.com/t/extract-python-code-from-packages/15549 "2017-10-11T11:36:11Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![jorgen.fidjeland](https://avatars.discourse-cdn.com/v4/letter/j/53a042/32.png) [@jorgen.fidjeland](https://forum.dynamobim.com/u/jorgen.fidjeland)\
**Post date:** [October 11, 2017, 11:36am UTC](https://forum.dynamobim.com/t/extract-python-code-from-packages/15549/1 "2017-10-11T11:36:11Z")

</div>

Hi,

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?

---

<div class="post-metadata">

**Author:** ![MartinSpence](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/martinspence/32/25208_2.png) [@MartinSpence](https://forum.dynamobim.com/u/MartinSpence)\
**Post date:** [October 11, 2017, 11:48am UTC](https://forum.dynamobim.com/t/extract-python-code-from-packages/15549/2 "2017-10-11T11:48:18Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [October 11, 2017, 11:59am UTC](https://forum.dynamobim.com/t/extract-python-code-from-packages/15549/3 "2017-10-11T11:59:13Z")

</div>

> [@jorgen.fidjeland](#):
>
> s there anyway to get the python code used in a rhythm node and then put this code in a code-block instead?

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.

---

<div class="post-metadata">

**Author:** ![Nick\_Boyts](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick_boyts/32/76313_2.png) [@Nick\_Boyts](https://forum.dynamobim.com/u/Nick_Boyts)\
**Post date:** [October 11, 2017, 12:00pm UTC](https://forum.dynamobim.com/t/extract-python-code-from-packages/15549/4 "2017-10-11T12:00:19Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jorgen.fidjeland](https://avatars.discourse-cdn.com/v4/letter/j/53a042/32.png) [@jorgen.fidjeland](https://forum.dynamobim.com/u/jorgen.fidjeland)\
**Post date:** [October 11, 2017, 12:41pm UTC](https://forum.dynamobim.com/t/extract-python-code-from-packages/15549/5 "2017-10-11T12:41:29Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Nick\_Boyts](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick_boyts/32/76313_2.png) [@Nick\_Boyts](https://forum.dynamobim.com/u/Nick_Boyts)\
**Post date:** [October 11, 2017, 12:48pm UTC](https://forum.dynamobim.com/t/extract-python-code-from-packages/15549/6 "2017-10-11T12:48:48Z")

</div>

Lacing relates to how lists are managed within a function. I suggest checking out the Primer.  
[http://dynamoprimer.com/en/06\_Designing-with-Lists/6-1\_whats-a-list.html](http://dynamoprimer.com/en/06_Designing-with-Lists/6-1_whats-a-list.html)

---

<div class="post-metadata">

**Author:** ![john\_pierson](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/john_pierson/32/191977_2.png) [@john\_pierson](https://forum.dynamobim.com/u/john_pierson)\
**Post date:** [October 11, 2017, 1:04pm UTC](https://forum.dynamobim.com/t/extract-python-code-from-packages/15549/7 "2017-10-11T13:04:37Z")

</div>

> [@jorgen.fidjeland](#):
>
> a node from rhythm in my dynamo script

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

---

<div class="post-metadata">

**Author:** ![jorgen.fidjeland](https://avatars.discourse-cdn.com/v4/letter/j/53a042/32.png) [@jorgen.fidjeland](https://forum.dynamobim.com/u/jorgen.fidjeland)\
**Post date:** [October 11, 2017, 1:07pm UTC](https://forum.dynamobim.com/t/extract-python-code-from-packages/15549/8 "2017-10-11T13:07:41Z")

</div>

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](https://forum.dynamobim.com/t/select-elements-on-screen-fill-out-parameter/7094/33)

---

<div class="post-metadata">

**Author:** ![john\_pierson](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/john_pierson/32/191977_2.png) [@john\_pierson](https://forum.dynamobim.com/u/john_pierson)\
**Post date:** [October 11, 2017, 1:17pm UTC](https://forum.dynamobim.com/t/extract-python-code-from-packages/15549/9 "2017-10-11T13:17:03Z")

</div>

Of course, glad to hear that it is useful!

To pull that python code out it will look like this in your graph.  
 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/1/0/10b98b570630961dacf21977cce06f88c5846d47.png)

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.
