pyRevit
pyRevit copied to clipboard
Need to know the "capabilities" of pyRevit: lets define the "API Level"
As pyRevit is in constant development, I think it would be good to differentiate the API, according to some introduced or changed functionality.
What I found recently, is the pickling code. It was changed dramatically (eg. DB.XYZ() instead of Point()) and it broke almost all my addin :)
Let's define the 'capabilities' level in API, like it is done in eg Android. So, the code could look like:
if pyrevit.api.level < 42 :
# use the deprecated API calls
else:
# use shiny new API calls
This will allow distinguishing between the release of pyRevit and the major change in pyRevit API.
The app.is_newer_than() is not suitable for this purpose, because it defines the version of host ( Revit application ), not the pyRevit.
You can almost do that by checking VERSION_MAJOR
and VERSION_MINOR
from pyrevit
module