Easiest solution to Deploy Addin in Offcie

Easiest solution to Deploy Addin in Offcie

stingers80-cgarchitect
Advocate Advocate
2,499 Views
10 Replies
Message 1 of 11

Easiest solution to Deploy Addin in Offcie

stingers80-cgarchitect
Advocate
Advocate

Hi everone!

I'm kind of new to this whole API but I have prepared some small codes to be used throughout office.

 

I know this question has been asked back in 2016 but I didn't see any easy solution. I just want to see if there is an easier way after 3 years to push an Addin to users at my office. Considering possible updates that might need to be done to Addins is it better to have them on Network?

Could it be easier to change the code for a Macro and push that to individual projects or each user's Revit?

 

How are you deploying them in your office?

We have a small office size with around 12 Revit users.

0 Likes
Accepted solutions (1)
2,500 Views
10 Replies
Replies (10)
Message 2 of 11

jeremytammik
Autodesk
Autodesk

All you need to deploy an add-in is to copy the add-in manifest *.ADDIN file and the .NET assembly *.DLL to a specific location on the target machine.

  

To deploy a macro, all you need is to copy an RVT. For an application macro, I imagine it would be a handful of files.

  

You could also consider deploying your code as a Dynamo package or a RevitPythonShell script.

  

By the way, the RevitPythonShell installer is available as source code and demonstrates how you can deploy an add-in to any machine with a single click:

  

https://github.com/architecture-building-systems/revitpythonshell

  

What restrictions are you facing?

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes
Message 3 of 11

stingers80-cgarchitect
Advocate
Advocate

thanks for reply Jeremy,

 

my restrictions are (10+)Machines each with 3 versions of Revit and the fact that I don't want to copy files for each of them manually. I don't know in the long run how I will be able to update the codes for these machines and I can't rely on individuals to do it themselves. This part is important since I'm not a professional coder.

Macro seems a good idea if I can import them in our Template file or just open each ongoing project and copy it in the project. Still I will need to rewrite codes for Macro.

 

Dynamo would be great! but I'm writing code in c# as Addin. Is there an easy way to convert them to Dynamo nodes? As I have heard there are some differences between codes for Dynamo node and Addin.

 

thanks,

0 Likes
Message 4 of 11

465565873s
Participant
Participant

Hi, I'm facing the same problem as you. Just as Jeremy said, you need to copy compiled files (.dll .addin and maybe .pbd) to the target machine. 

 

I found a fairly easy way to achieve this using a batch file. It copies these file from a server to user's Revit addin directory.

 

 

@echo off
rem --------------------------------------------COPY FILE TO TARGET MACHINE-------------------------------------------
rem /i option is needed to avoid the batch file asking you whether destination folder is a file or a folder
rem /e option is needed to copy also all folders and subfolders
rem /y option is needed to overwrite existing files without prompt 
if not exist "%USERPROFILE%\AppData\Roaming\Autodesk\Revit\Addins\2019\" mkdir "%USERPROFILE%\AppData\Roaming\Autodesk\Revit\Addins\2019\"
DEL /F/Q/S "%USERPROFILE%\AppData\Roaming\Autodesk\Revit\Addins\2019\" > NUl   
xcopy "YOUR ADDIN DIRECTORY" "%USERPROFILE%\AppData\Roaming\Autodesk\Revit\Addins\2019" /i /e /y
pause

del %SCRIPT%
 
 
In my case it does require individual user to click on the batch file to download/update, but I reckon you could modify the code so that it copies to everyone's machine by one click from you.
 
Hope it helps.
Message 5 of 11

H.echeva
Advocate
Advocate

I am also interested in this.

 

What I have done in my office is to put the .dll in a read-only location in the server and I created a BATCH file to copy the .addin to each person's computer. This way I just need to go to their computer and click on the BATCH file. And if I want to make changes to the tools I just have to overwrite the .dll in the server  and everybody gets the update.

 

However, I am not sure if this a good practice as many people are reading the same dll.

 

Regards

0 Likes
Message 6 of 11

j.buijs
Enthusiast
Enthusiast
Accepted solution

@H.echeva  Why not also copy the .dll file? I copy my .addin and .dll files from a location on our server to all BIM modellers' workstations using Group Policy, so I know that everyone will get an updated version if I just change the file on the server.

Message 7 of 11

H.echeva
Advocate
Advocate

Hello@j.buijs 

 

That is, in fact, a good idea. When I started my strategy I was new in the office and didn't know about the group policy.

But I will have a chat with the IT managers and ask them to do this.

Thanks!

 

0 Likes
Message 8 of 11

dantartaglia8696
Advocate
Advocate

An addin can consist of many more files. I tend to use a packaging tool like CreateInstall then have our Infrastructure group use SCCM to either automatically deploy silently or make them available in Software Center. In some situations keep the packaged tools on a network drive for users to install if needed.

Message 9 of 11

j.buijs
Enthusiast
Enthusiast

You can also use installers with Group Policy as well. In my experience this works the best in a company network.

Message 10 of 11

baleti3266
Advocate
Advocate

disassemble your dll and its references, concatenate it, paste into excel spreadsheet and attach it to an email for all the colleagues to enjoy

0 Likes
Message 11 of 11

kaiZQHQ4
Participant
Participant

I would recommend this package ricaun.Revit.PackageBuilder, it repackages Nuke (another C# package) and can automate creating an installer for you. You could then send this installer to your collegues or set up releases on Github. Its super cool becasue it just automates so much.

It's quite simple to set up although the documentation is lacking. I just set it up in my project and will be adding to the README sometime soon.