# Generative Design Python Script Node Issues

**URL:** <https://forum.dynamobim.com/t/generative-design-python-script-node-issues/93044>\
**Category:** Generative Design\
**Tags:** revit, python, dynamo\
**Created:** [August 21, 2023, 8:23am UTC](https://forum.dynamobim.com/t/generative-design-python-script-node-issues/93044 "2023-08-21T08:23:14Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![thanhdatp297GRTHP](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/thanhdatp297grthp/32/167370_2.png) [@thanhdatp297GRTHP](https://forum.dynamobim.com/u/thanhdatp297GRTHP)\
**Post date:** [August 21, 2023, 8:23am UTC](https://forum.dynamobim.com/t/generative-design-python-script-node-issues/93044/1 "2023-08-21T08:23:14Z")

</div>

Hi everybody, I tries to creat a generative design study, when I set Graph Type for this I have meet a Node issues that:  
These nodes are revit dependent and therefore need to be cached. nodes that needs to be cached cannot be placed in a evaluation loop ( after an input node and before an output node), Remove the nodes that occur in the evalutation loop.  
Can someone explain to me the reason behind this message and how to fix it.  
Thank you very much!

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/7/9/7933247de77ea8450ca6a7be33b2f1b500b2db3d.png)  
my script in the link below

> **[BikeParking Layout-0.2.dyn](https://drive.google.com/file/d/12vPTM0W8xcMP2oejGiBPUzHws1NJ9r6a/view?usp=sharing)**
>
> Google Drive file.

---

<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:** [August 21, 2023, 2:02pm UTC](https://forum.dynamobim.com/t/generative-design-python-script-node-issues/93044/2 "2023-08-21T14:02:03Z")

</div>

Generative Design doesn’t have any access to the Revit API, and as such you need to make the graph execute correctly in Dynamo Sandbox by converting all Revit data into a simplified data type and serializing it into a Data.Remember node. Any nodes which record the final output need to go after a Data.Gate node.

All the variation in outcome and evaluation needs to happen between the Data.Remember and the Data.Gate node.

---

<div class="post-metadata">

**Author:** ![thanhdatp297GRTHP](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/thanhdatp297grthp/32/167370_2.png) [@thanhdatp297GRTHP](https://forum.dynamobim.com/u/thanhdatp297GRTHP)\
**Post date:** [August 21, 2023, 3:12pm UTC](https://forum.dynamobim.com/t/generative-design-python-script-node-issues/93044/3 "2023-08-21T15:12:23Z")

</div>

hi Jacob, thank for your answer, I tried to do geometry operations only in dynamo sandbox as you can see in my node python script i am not clear where i did wrong.

---

<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:** [August 21, 2023, 3:14pm UTC](https://forum.dynamobim.com/t/generative-design-python-script-node-issues/93044/4 "2023-08-21T15:14:54Z")

</div>

Can’t really see your code as you only posted a screenshot, but I do see a reference to the Document manager, which requires the Revit access and therefore won’t work in Sandbox. Even if you don’t use a method but import a Revit class it will fail.

Try running your code in Dynamo Sandbox and the Revit API calls will be made quite clear.

---

<div class="post-metadata">

**Author:** ![thanhdatp297GRTHP](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/thanhdatp297grthp/32/167370_2.png) [@thanhdatp297GRTHP](https://forum.dynamobim.com/u/thanhdatp297GRTHP)\
**Post date:** [August 21, 2023, 3:31pm UTC](https://forum.dynamobim.com/t/generative-design-python-script-node-issues/93044/5 "2023-08-21T15:31:26Z")

</div>

Thanks you. I will try it

---

<div class="post-metadata">

**Author:** ![thanhdatp297GRTHP](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/thanhdatp297grthp/32/167370_2.png) [@thanhdatp297GRTHP](https://forum.dynamobim.com/u/thanhdatp297GRTHP)\
**Post date:** [August 22, 2023, 2:28am UTC](https://forum.dynamobim.com/t/generative-design-python-script-node-issues/93044/7 "2023-08-22T02:28:40Z")

</div>

I removed the revit related library import lines and it worked, thank you

---

<div class="post-metadata">

**Author:** ![thanhdatp297GRTHP](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/thanhdatp297grthp/32/167370_2.png) [@thanhdatp297GRTHP](https://forum.dynamobim.com/u/thanhdatp297GRTHP)\
**Post date:** [August 22, 2023, 4:15am UTC](https://forum.dynamobim.com/t/generative-design-python-script-node-issues/93044/8 "2023-08-22T04:15:04Z")

</div>

I just have another issue, when I running the script in dynamo it still return Output and geometry preview

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/1/5/15e63c849a0b1e9c1aa1ab60b65b4f305891943d.png)  
But when I ran it in generative design, no output value and no preview geometry is returned. Can you explain to me what happened?  
 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/4/e/4e16aa4f1df67a10132f4680a834209b6e2d5451.png)

---

<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:** [August 22, 2023, 4:25am UTC](https://forum.dynamobim.com/t/generative-design-python-script-node-issues/93044/9 "2023-08-22T04:25:18Z")

</div>

Do the same inputs return results in Dynamo Sandbox? If not, then whatever is preventing the outcome there is likely the issue for GD.

If so it could be parallel processing issues, exceeding the memory limit, or an external dependency failing.

Would need the graph posted for anyone in the community to review. Personally I won’t have time until after my vacation, and then I’ll need to clear the backlog for my day job first.

---

<div class="post-metadata">

**Author:** ![thanhdatp297GRTHP](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/thanhdatp297grthp/32/167370_2.png) [@thanhdatp297GRTHP](https://forum.dynamobim.com/u/thanhdatp297GRTHP)\
**Post date:** [August 22, 2023, 4:39am UTC](https://forum.dynamobim.com/t/generative-design-python-script-node-issues/93044/10 "2023-08-22T04:39:10Z")

</div>

I just tried it and results are the same 😃 It worked perfectly in Sandbox but still have problem with GD

---

<div class="post-metadata">

**Author:** ![thanhdatp297GRTHP](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/thanhdatp297grthp/32/167370_2.png) [@thanhdatp297GRTHP](https://forum.dynamobim.com/u/thanhdatp297GRTHP)\
**Post date:** [August 22, 2023, 4:45am UTC](https://forum.dynamobim.com/t/generative-design-python-script-node-issues/93044/11 "2023-08-22T04:45:06Z")

</div>

[BikeParking Layout-0.6.dyn](https://forum.dynamobim.com/uploads/short-url/nprYzLycCChMDBP0D43VHAe0Pfk.dyn) (168.0 KB)  
this my script, please help me check it when you come back
