AttributeError: object 'TaskDialog' has no attribute 'Show'

Since today i’m getting an error when i’m running this script in Revit 2023.1
Is was always working for 100% in Revit 2021, 2022, 2023, ending with a dialog.
I did no changes for weeks.
Does anybody know what’s going wrong?

test pin-palen_script.dyn (12,2 KB)

image

import clr
#add a reference to the Revit UI .dll so we can access the UI Namespace...
clr.AddReference('RevitAPIUI')
#import everything from the UI Namespace...
from Autodesk.Revit.UI import *

#IN Variabele
#hoogtes = IN[0]
msg = "Elementen met Assembly Code 17.XX (paalfunderingen) zijn nu gepinned."

#show the message dialog box...
TaskDialog.Show("Bericht", msg)
#return a result in Dynamo...
OUT = msg

UPDATE:
After re-installing the packages i get another new error. :frowning:
Cannot extend an incomplete type ‘MulticastDelegate’.
image

I tried your code on Revit 2024 and it works. As far as I can read from warning there might be a problem with Dynamo DLLs. Can you try to re-install Revit?

Sorry, can’t do this. Revit is installed in a Citrix-environment for many users. Revit is not on my C-drive.
The packages are available via Onedrive in a synchronized folder.
It always works, but somehow not on my pc.
Probably its a unique user-settings what’s going wrong.
I will check my settings again.

Update:
I’ve changed my settings en went back again.
Still an error. See screenshot.
I don’t know how to resolve this.
image

Can you try it with IronPython? It seems like CPython3 problem…

See this post…

Thangs @haganjake2 / @Deniz_Maral

Hmm… strange things happens.
All my scripts are written in CPython3 and always worked fine.
My scripts did always work (on local drive or in Citrix-environment), but somehow not anymore everywhere.

This are my results today.
Revit 2023.1 on my local drive: script does not work
Revit 2023.1 in Citrix-environment: script works (as expected)

In both situations; signed in with the same Autodesk-ID

The script works in IronPython2 and IronPython3
The script does not works in CPython3

1 Like