Sharepoint Extension Directory

I have been developing a PyRevit extension for my company. We are now looking to deploy it to a number of our designers for testing.
Once we roll out to our full design team, is there a way to have the Extension Directory point to a SharePoint web address, to ensure everyone has access to the latest version? If not, how would you recommend deploying a custom PyRevit extension?

If everyone has access to a mapped server drive letter as in most offices…
Just place your extensions on a shared drive.
Under pyRevit settings, add your folder to Custom Extension Directories.

Simple as that.

Each user can have different lists of extensions if you want to break things down in different modules.

Thanks for your reply. We do not have any on site servers, we unitise SharePoint (so there is no drive letter to path to), which when pointed to through file explorer has a path including the users username.

Not sure if the SharePoint path will work. It might.
However, your users could map a drive letter to SharePoint.

Hey @CDennis,

Is there any reason you don’t want to use the pyRevit for Teams approach? You can deploy the scripts to all of your users computers via a remote repo (i.e. GitHub), and would be able to push out updates using the pyRevit CLI. While we’re typially always online when modeling, it does provide the benifit of being able to run scripts while offline.

-Justin

I can give some insight on not wanting to use the teams approach.
A good portion of the work we do is with the US military. The government is coming down hard on IT security and we have outside IT management. Every executable has to be tested and whitelisted. Yes, a real pita. However - I can update scripts on a server without having to go thru a whole IT ticket and weeklong process of testing and deployment. Having code on the central server allows on-the-fly updates.

1 Like

Don’t put it on a server unless your server is fast, as it will throttle Revit’s opening time.

The best approach is to get a copy of the toolbar onto the user’s local machine, in a location such as their roaming appdata folder.

I would suggest looking into deployment using either an application like Intune/PDQ deploy or a user group policy and xcopy type approach that runs on machine startup. This will require your IT manager to help most likely, but it’s fairly basic stuff if they’re any good at their job.

Honestly I would not suggest the git/CLI approach as it’s too technical to scale well and most IT departments don’t know git in my experience. It works great for public extentions but for private ones is more effort than it’s worth.

2 Likes

Watch out for them if they begin talking about Python/IronPython. Australian DOD is finally clueing on to the risks with using IP2.X and have recently said no to pyRevit for a lot of our projects (fair enough too… IP2 is ancient). It’s only a matter of time before other countries clue on. This lead me into C# eventually.

Basic stuff is a challenge. Throw Vray, Enscape, Unreal, Steem and VR at them - and well. :wink:
Keeping very quiet about all coding languages from Photoshop, VBA, Python , Maxscript. Stretch things out until I can exit the profession stage left.

2 Likes

Thanks, this sounds like the best approach for my deployment. I will have a chat with my IT Manager.

I deployed a custom pyrevit extension to my firm. The easiest method is to use Github as pyrevit has built-in methods to install and update via the command line from Github.

2 Likes

This has been my go to method for years.
pyrevit CLI command to install once pyrevit is installed
pyrevit extend ui *nameExtension* *https://gitrepourl* *C:\directorytoinstallto* --token="*leikraherakljgherdkjlgertdhj*"
you can make a bat file to run the command,
and to update, you can use the same principal but make it a pushbutton or a startup script to auto update on startup of revit

1 Like

Hey Jean-Marc,

So I had an updater button on our extension that would essentially enter in those CLI commands via the subprocess module.

My IT dept changed our group policy on our machines that would cause the command terminals to open in either regular or admin mode. The weird part is that if ran in admin mode, pyrevit will sometimes not find the extensions I am trying to update and fail.

To work around that, I directly work with the git library via pyrevit.coreutils and just check the heads and pull if the current head is behind. This method works perfectly.

but now my .bat files dont work for everyone including myself. When I open command prompt, I will either be in ‘C:’ or ‘U:’ and I haven’t been able to discern why thats the case. Have you encountered anything like this?

The same way I guess, the way I do it:

To update:

startup.py in my extension contains:

from subprocess import call
token = "github_pat_654rthtsrfhn"
call('cmd /c "pyrevit extensions update my_toolbar --token="{0}""'.format(token), shell=True)

To install

from the command line (either in admin or non admin _ you need to check how pyrevit was installed running pyrevit env to see if your pyrevit clone is there):

pyrevit extend ui my_toolbar https://github.com/jmcouffin/my_toolbar.git --dest="C:\pyRevit" --token="github_pat_658rtssrtfh6"

you could us the cd C:\properFolderLocation command to make sure you are in the proper folder