Tuesday, November 20, 2012

Part 2 - RPS Configuration

In Part 1, we discussed about installing all the necessary software. In Part 2, we will review the Revit Python Shell configuration and general overview of its functions.

RevitPythonShell Configuration


 
The RevitPythonShell can be accessed from within Revit Architecture’s Add-Ins tab. It contains two options, Configure and Interactive Python Shell.

First, you must configure the Revit Python Shell and add the library path of the IronPython as a search path:

·         Select Configure

·         Add IronPython library path :   C:\Program Files (x86)\IronPython 2.7\Lib

o   OR

·         Edit the configuration in RevitPythonShell.xml

C:\Users\YourLoginName\AppData\Roaming\RevitPythonShell2013

    Add the search path in the xml file:
 <SearchPath name="C:\Program Files (x86)\IronPython 2.7\Lib"/>

Once the configuration is saved, you must exit Revit, and restart Revit for the changes to take effect.

Interactive Python Shell

 

  The Interactive Python Shell contains two sections. The top section is the command prompt area. The bottom section is the python editor. In the command prompt area, you will see >>> as the primary prompt and … as the secondary prompt when you write multi-line codes. Codes entered in the command prompt area will be executed immediately once you hit the enter key. In the lower editor section, you can type new codes or load an existing codes from any text file. Run the codes by hitting F5 or the play button . Please note that in the editor, you can only SAVE to a file, there is no SAVE AS button. When you load an existing file and make changes to it, you can only save and overwrite the original code, you don’t have the option to SAVE AS a different file. If you want to start a new code using an existing code as base, copy and rename the file in Window’s explorer first before loading it into the Python Editor.



No comments:

Post a Comment