I'm able to make a simple working UI on VS launched with ipy interpreter but when I try to launch it in Revit environment (revit python shell or macro), I got the following error : ImportError: No module named wpf
wpf is a built-in module, so I don't think I forgot any reference or pythonpath.
I checked both sys.version (idea from a post on stackoverflow): import sys print sys.version
and got the same result on revitpythonshell and Ironpython console : 2.7.4 (IronPython 2.7.4 (2.7.0.40) on .NET 4.0.30319.18444 (64-bit)) un2.7.4 (IronPython 2.7.4 (2.7.0.40) on .NET 4.0.30319.18444 (64-bit))
Any idea ?
I wonder... could it have to do with the search paths? I tried doing this in the ironpython console:
but got no result, so I checked the filesystem for some other places the module could come from. So I did this:
Then do:
import clr clr.AddReference('IronPython.Wpf') import wpf
On my machine that works. Of course this means you need to install IronPython on your system - RevitPythonShell ships with an IronPython version, but just includes the main dlls.