It’s here! Daren Thomas has posted installers for RevitPythonShell for BOTH Revit 2012 and Vasari 2.1.
What does this mean? You, dear reader, can now script live in a Vasari session using Python. Behold!
The samples I’m showing are things that I am not capable of cobbling together on my own . . . I’m NOT AT ALL a coding person. It’s actually my desperate hope that you will understand these concepts much better than I and do something cool with the tools. Keep an eye on Nathan Miller’s site, I’m sure he will have good stuff. My Create Surface script is a simplification of his supershapes script posted here. Thanks to Aki Hogge for everything else.
I have tried a bunch of times to get through “Hello World” in both full Visual Studio and VSTA for Revit and each time just failed miserably. I’ve had much more success with this tool and can see a way to actually progressing in my API education. So if you have tried and failed with the Revit API in the past, give this a shot. Here’s the text version of how to get started:
RevitPythonShell for Vasari in 5 minutes:
- Run Vasari at least once on the computer in question
- Install IronPython: http://ironpython.net/
- Install RevitPythonShell: http://code.google.com/p/revitpythonshell/downloads/detail?name=Setup_RevitPythonShell_Vasari_TP2.1.exe#makechanges
- Download some starter samples from here.
- Open Vasari >Addins tab>RevitPythonShell>Configure . . .>
- In Search Paths tab, add the Lib folder in your IronPython installation (ex, C:\Program Files (x86)\IronPython 2.7\Lib), this is for autocomplete
- In Commands tab>Add> select the attached pySamples
- Save and restart Vasari. Play with samples.
All the samples run in Mass.rfa files, GoalSeeker uses the Goalseeker example files. It all works in either Vasari or Revit.
To monkey with the scripts live, just open them in an editor (notepad works, I’m sure there are way better ones) make changes, save and then run again in Vasari.
There’s no official SDK or documentation for the Vasari API, but it is essentially a slimmed down version of the Revit API, with detail model elements and such removed.