DynamoDS / Dynamo

Open Source Graphical Programming for Design
https://dynamobim.org
Other
1.72k stars 632 forks source link

CPython3 - 'System.Reflection.Emit.TypeBuilder' was not found - Dynamo 3.0.3 #15347

Closed chrizzrott77 closed 3 weeks ago

chrizzrott77 commented 3 months ago

Dynamo Version

3.0.3.7597 (Dynamo Revit 3.0.3.4605)

Host

No response

Operating System

Microsoft Windows NT 10.0.22631.0

What did you do?

try to use events subscription with CPython3

Code inside Python Code Block:

import clr clr.AddReference('System.Windows.Forms') from System.Windows.Forms import Form, TextBox, Button, DialogResult

def create_input_box():

Fenster erstellen

form = Form()
form.Text = "Input Box"
form.Width = 300
form.Height = 150

# TextBox erstellen
text_box = TextBox()
text_box.Width = 200
text_box.Top = 20
text_box.Left = 50
form.Controls.Add(text_box)

# Button erstellen
button = Button()
button.Text = "OK"
button.Width = 50
button.Top = 60
button.Left = 125

# Event-Handler für den Button
def on_button_click(sender, e):
    form.DialogResult = DialogResult.OK
    form.Close()

button.Click += on_button_click
form.Controls.Add(button)

# Dialog anzeigen
form.ShowDialog()

return text_box.Text

Text von der Eingabe-Box holen

input_text = create_input_box()

Dynamo Output

OUT = input_text

What did you expect to see?

not an error

What did you see instead?

Python Error: image

What packages or external references (if any) were used?

No response

Stack Trace

No response

Details

Related Issue: https://github.com/DynamoDS/DynamoRevit/issues/3008#issue-1994713029

CLR: 8.0.6

github-actions[bot] commented 3 months ago

Thank you for submitting the issue to us. We are sorry to see you get stuck with your workflow. While waiting for our team member to respond, please feel free to browse our forum at https://forum.dynamobim.com/ for more Dynamo related information.

avidit commented 3 months ago

@chrizzrott77 Can you try this on https://github.com/DynamoDS/Dynamo/releases/tag/3.2.1

Narimannp commented 1 month ago

Has anyone found a solution for this? this issue arises when updating from 2.18, 2.19 .

avidit commented 1 month ago

@Narimannp Can you try this on 3.2.1 (release)

If possible could you please update Revit to 2025.2 where the issue should be fixed.

Narimannp commented 3 weeks ago

I apprecite your responce. I wish i could. I need the script to work on both 2022 and 2025. Fortunantly i found a solution how to fix the issue in earlier versions.

avidit commented 3 weeks ago

That's great. Could you please share the solution you found?

Narimannp commented 3 weeks ago

Sure, it is super simple, actually you only need to install ironpython package (the version which is compatible with your dynamo version) and run the script with ironpython instead of cpython.