I love it when people take something I hacked together and make it even better! A while ago I posted a script to disable all Revit addins, and recently Thomas Vogt sent me some much improved versions.

  • Deactivate with Teilnehmer08_1_RevitAddonsDeaktivierenPowerShell.ps1
  • Activate with Teilnehmer08_2_RevitAddonsAktivierenPowerShell.ps1

 

You can download a ZIP file containing the Powershell scripts here:

Addin_Activate_Deactivate_2017-2020

 

Disclaimers (use at your own risk etc) and notes on how to use the scripts are as per previous post.

 

Here is the note from Thomas:

Hi Luke,
I have used your script from https://wrw.is/script-to-disable-all-revit-addins/ and I have adjusted it a bit. I have local users without admin rights (training center computers), so I go to the users computer, open the file with rightclick > Powershell and the Admin login is shown. I got also some problems with the allusersprofile and the appdata path variable, because as soon as I login as admin, the appdata path is not anymore the user path. Thus I have changed it to the path itself. The last 2 lines help to see the errors.

Thanks for your script, it helped me a lot! My scripts are attached if you want to use it on your blog =)

Thanks to Thomas Vogt for sharing his work on this!

Sometimes you will want to monitor a folder for changes, and possibly export a file list to Excel for consumption in some other format, or perhaps as part of a notification workflow.

I adapted a Powershell script to export a file list using a selected file extension as a filter, and also export some file properties like Directory and LastWriteTime (Date Modified).

Here is the Powershell script:

$arr = @()
gci L:DIRECTORY -include *.nwc -recurse | ? {$_.PSIsContainer -eq $False} | % {
$obj = New-Object PSObject
$obj | Add-Member NoteProperty Directory $_.DirectoryName
$obj | Add-Member NoteProperty Name $_.Name
$obj | Add-Member NoteProperty LastWriteTime $_.LastWriteTime
$arr = $obj
}
$arr | Export-CSV -notypeinformation "C:TARGETFOLDERLOwnCloudWIP.csv"
Copy-Item "C:TARGETFOLDERLOwnCloudWIP.csv" "C:UsersLuke JohnsonGoogle DriveGOOGLEDRIVERFOLDERLOwnCloudWIP.csv" -force
<code>

Put the above in a text document and save with the .ps1 extension

Quick summary of how it works:

  1.  As it is a powershell script, you will need powershell installed and it will need to be enabled with appropriate permission etc to access the network.
  2. Set up the script as per text above
  3. Set up Windows task scheduler to call the script periodically. Each time:
    1. Script runs and creates a CSV of filenames and dates etc in the monitored folder
    2. This automatically syncs (using the Copy-Item step) to Google Drive where it is shared with a gd url
    3. The gd url of the csv file is imported into another Google Spreadsheet, where ARRAY formulas are performed on it to create additional filter parameters based on file name

This ‘filterable’ Google sheet was shared with an ‘lv’ key so that it could be easily filtered by recipients. I think the new Google Sheets allow per user filtering, so that step may be unnecessary now.

You may need to set some additional arguments in the Windows task:

arguments.png

The scheduled task looks like this:

task.png

After Google Reader was decommissioned, I was happy to find that inoreader was an excellent replacement. But one feature was missing: free and easy RSS Feed Translation. Did you know you can deploy your own Google Script to translate RSS feeds, and then subscribe to them in your preferred RSS Reader (like inoreader?)

Here are the steps, from labnol.org:

  1. Open the Google Script and choose File -> Make a copy to create a personal copy of that feed translation script into your Google Drive.
  2. Replace the source language (line #4), the target language (line #7) and the RSS feed URL (line #10) with your own values. (some language codes here)
  3. Go to File -> Manage Versions and choose Save a new version. You may leave the description field blank.
  4. Go to Publish -> Deploy as Web App, choose “Anyone, even Anonymous” under “Who can access the app” and click the Deploy button.

Google Script will now offer you a link to the web app. That’s actually the new URL of the translated RSS feed which you can directly subscribe in Google Reader or any other news reader app like Reeder, Flipboard, etc.

If you wish to translate another RSS feed, or offer the same feed but in another language, just go back to step #1.

via
How to Translate RSS Feeds with Google Scripts

Warning: some have had unexpected results, use with care.
Update: one reader discovered that  C:Program FilesAutodeskRevit 2015AddIns is yet another path that Revit uses. The script below has not been modified to act on that path, but if you have problems after running the tool, perhaps moving the items out of this folder to a backup folder will help. This user had the following errors in the Journal:
“managed exception occurred” and “An item with the same key has already been added” and ExceptionCode=0xe0434352

… If you are experiencing a problem with Revit starting up, it could be due to a problem with one or more of your addins. As you probably know, Revit looks in a couple of key directories for *.addin files, and then it loads your addins based on what it finds. Also, in current versions of Revit it also looks in an ApplicationPlugins folder at the .bundle folders.

I created a Powershell script that looks in each of these three folders (for Revit 2015) and then renames the addin files and bundle folders, meaning that you can then open Revit 2015 in “addin-free mode”. The script requires that you are loading addins from the default AppData and ProgramData folders.

Important note: there are two scripts that are intended to work as a toggle, and for troubleshooting purposes only. After you run the Enable script, do not run it again. Make sure you run the Disable script next.

Here is the intended workflow:

  1. Download and unzip the ps1 files
  2. Ensure all Autodesk products are closed
  3. Run the 1_DisableRevitAddons.ps1 script to disable all Revit 2015 addins
  4. Start Revit
  5. If it starts, you know that some addin is causing your problem
  6. Close Revit
  7. Run the 2_EnableRevitAddons.ps1 script to restore the addin and bundle folder names

You can download both Powershell scripts here

Here is a quick Screencast showing it in action:

And some sample code for the disable script:

 cd $env:ALLUSERSPROFILEAutodeskRevitAddins2015  
Dir | Rename-Item –NewName { $_.name –replace “.addin“,”.addin.disabled” }
cd $env:ALLUSERSPROFILEAutodeskApplicationPlugins
Dir | Rename-Item –NewName { $_.name –replace “.bundle“,”.bundle.disabled” }
cd $env:APPDATAAutodeskRevitAddins2015
Dir | Rename-Item –NewName { $_.name –replace “.addin“,”.addin.disabled” }

After running the Disable script, you will end up with something like this:

Important: This is an extreme troubleshooting measure, and should be used with great care. Use at your own risk!

Here are some of the warnings / errors from the Powershell output. Some of these are due to the fact that I had Navisworks open and it could not rename those *.bundle folders. Various Autodesk products share the ApplicationPlugins folder, so it may have some unintended consequences on other products. Having said that, it seemed to work ok on my system.

In one recent post, Paul Crickard describes how you can use a URL field in a Revit schedule to:

  • open documents or images
  • open a video
  • open a map or facility plan to a specific geographical location
  • retrieve data from an external database

These points are along similar lines to my post about launching scripts and programs directly from Revit. The same principles apply to families with a URL parameter.

From Architecture and Planning:
Changing HTTP to FILE makes it a local file browser. I created a room in Revit and added a parameter of type URL. The URL added is:

file:///c:/Users/Paul/Desktop/efpGIS/Config/Splash.png

This URL links to a picture on my desktop. If I click the link in Revit, I get the image on the right. The computer knows to launch the appropriate program to open the file. A link to a AVI file opens my Divx Player.

Read the whole post:
URL Tricks in a Revit Schedule | Architecture and Planning

From Revit Randoms

  1. Download the files here: Upgrade_PurgeUnused.zip
  2. Extract to a folder of families you want to purge.
  3. Copy the first family in your category and paste and rename it in the same folder.
  4. Edit the ‘Upgrade_PurgeUnused.txt’ file.
  5. Insert the file path of your ‘dummy’ family file.(update all 3 file paths)
  6. Save and close.
  7. Run the upgrade.rfa script.
  8. Drag the ‘Upgrade_PurgeUnused.txt’ file onto your Revit icon. (make sure Revit is closed first.)
  9. Watch in amazement as Revit opens and purges your families.
  10. Go make coffee.

Now this can be used on any category of family, but you will need to make a dummy family that can be loaded into each category, else it will not work.

Read more at:
http://revitrandoms.blogspot.com.au/2013/08/purge-unused-in-families.html

In the post, he also references some journal scripts by Aaron Maller that use the old File Upgrader to Transfer Project Standards from a project to families. The benefits of the old Upgrader are shown at: http://cadalot-revitlearningcurve.blogspot.com.au/2011/06/file-upgrader-for-revit-vs-content.html

Heads-up

This technique allows file operations and programs to be initiated from an in-canvas Revit modelling session, without the need to switch to Windows Explorer.

Basically, you just need a Symbol family with URL instance parameter.  In the URL parameter, paste a fully resolved path to the script or exe file (you can use Shift + rightclick to quickly get this from Explrorer in Windows 7).  Now, when you select the Symbol family, click on the dots in the Properties Palette  – the exe or script will run, directly from Revit

Potential uses:

  • Launch any program
  • Launch a program that may be useful in-canvas (like Colorette)
  • Launch a search program like Locate32, that can be used to search for Revit content and drag-drop into the Revit session
  • Copy point clouds to local drive
  • Map network drives
  • Archive RVT folder script, perhaps using 7-zip
  • Run Autodesk program update packages (some of these may require Revit to be shutdown)
  • Run add-in installers (that will probably require Revit to be updated)
  • Copy macro updates
  • Delete Revit backup files script
  • Clean up Journal folder
  • Make a backup of Keynote file or Shared Parameter file (perhaps used before editing)
  • Run Windows Task Scheduler tasks
  • Shutdown the computer

Once you have the Annotation family loaded and placed, just add the suitable path, and then select the element and click where the little dots should be:

The command is instantly triggered.

In a worksharing environment, you could set up a Drafting View where you placed different instances of this “linker” family to trigger various project-related scripts.

This idea grew from this post and this one about copying Point Clouds.

I wanted to grab a list of files so I could check if I had reviewed the contents of some MEP training videos.  You can easily do this using a Windows Powershell script.

Code example:

get-childitem “T:MEP (Revit MEP)MEP VIDEOS” -recurse | select-object DirectoryName,Name | where { $_.DirectoryName -ne $NULL } | Export-CSV C:Filelist.csv

Read more:
How to list all files in a directory and subdirectories

An announcement was made recently on the “Revit Deployment & Management for Medium Sized Offices” Udemy course (see here for more info):

We seem to have just discovered an interesting “bug” in Deployments as they relate to Revit Server. The Rollout Tool offers at least a partial solution, but I would like to collaborate with an office or two who are using Revit Server, and prioritize any additions to the script. If you are using Revit Server, and can spare a little time to discuss the issue and how it might impact your specific configuration, and what the Rollouts can do to help, please email me directly (email hidden). I’ll schedule a GotoMeeting for some time that works for you and we can proceed from there.

Thanks!

Gordon Price