pyRevit icon indicating copy to clipboard operation
pyRevit copied to clipboard

Need to know the "capabilities" of pyRevit: lets define the "API Level"

Open ejs-ejs opened this issue 2 years ago • 1 comments

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.

ejs-ejs avatar Aug 18 '22 22:08 ejs-ejs

You can almost do that by checking VERSION_MAJOR and VERSION_MINOR from pyrevit module

eirannejad avatar Sep 04 '22 21:09 eirannejad