
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I try to run IronPython scripts via IronPython.Hosting in C# inspired by Nick Cosentino in blog “Python, Visual Studio, and C#… So. Sweet”
The purpose of such effort is to create easy distributable and accessible addins in our company which are developed by small group of non IT experts on IronPython platform due to it’s flexibility and lower demandings for coding skills. Yes I’have heard about RevitPythonShell, but this is not exactly what would make sufficient result.
I was able to run classes from references RevitAPI and RevitAPIU but when it came across RevitServices >:
from RevitServices.Persistence import DocumentManager
doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
uidoc = DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument
>the result are empty objects
I wonder if this intention to run such scripts is useless effort due to some restrictions in source code or there is some way how to deal with this issue.
Any idea would be valuable.
Thanks,
Daniel Gerčák
I’m adding piece of code for better overview.
Solved! Go to Solution.