Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
chrizzrott77 opened this issue Jun 25, 2024 · 7 comments
Closed
Labels

Comments

@chrizzrott77
Copy link

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:
DynamoDS/DynamoRevit#3008 (comment)

CLR: 8.0.6

Copy link

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
Copy link
Contributor

avidit commented Jun 25, 2024

@Narimannp
Copy link

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

@avidit
Copy link
Contributor

avidit commented Sep 5, 2024

@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
Copy link

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
Copy link
Contributor

avidit commented Sep 10, 2024

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

@Narimannp
Copy link

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.

@avidit avidit closed this as completed Sep 12, 2024
@github-project-automation github-project-automation bot moved this from Triage to Done in Dynamo Issues Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

No branches or pull requests

4 participants