Novice Question | Failed to initialize the add-in

Novice Question | Failed to initialize the add-in

Anonymous
Not applicable
1,429 Views
5 Replies
Message 1 of 6

Novice Question | Failed to initialize the add-in

Anonymous
Not applicable

Hello,

 

I'm new to this.

 

I'm wanting to utilise the PurgeUnused macro from Matt Taylor:
https://gitlab.com/MattTaylor/RevitPurgeUnused

 

Using My First Revit Plug-In, I am trying to get a feel of how to run it: 

1. Download files from GitHub

2. Extract and place at "C:\ProgramData\Autodesk\Revit\Addins\2019"

3. Open PurgeUnused.sln in Visual Studio

4. Go to PurgeUnused properties and changed Target Framework to .NET Framework 4.7

5. Change Copy Local to False for RevitAPI.dll and RevitAPIUI.dll

6. Build Solution

7. Place PurgeUnused.addin file in "C:\ProgramData\Autodesk\Revit\Addins\2019"

8. Open Revit

 

Then I receive the error:

"Failed to initialize the add-in "Purged Unused" because the assembly "PurgeUnused.dll" does not exist."

 

I found this:

https://forums.autodesk.com/t5/revit-api-forum/failed-to-initialize-add-in-cannot-be-found-in-assemb...

 

but my file doesn't seem to be disabled under the Properties > General tab.

 

Any guidance would be much appreciated.

 

Thanks,

Connor

0 Likes
Accepted solutions (1)
1,430 Views
5 Replies
Replies (5)
Message 2 of 6

novesvalentin
Advocate
Advocate
Accepted solution

Dear @Anonymous ,

 

You are missing a step, you have to compile you solution in Visual studio Build>Build solution, and then go to your solution folder Bin>Debug>urgeUnused.dll, copy that file together with the PurgeUnused.addin file in "C:\ProgramData\Autodesk\Revit\Addins\2019" and that should solve it.

 

Best regards

If this helped solve your problem please mark it as solution, so other users can get this solutions as well.



Valentin Noves

BIM Manager
www.valentinnoves.com
0 Likes
Message 3 of 6

Anonymous
Not applicable

@novesvalentin  thank you!

0 Likes
Message 4 of 6

jeremytammik
Autodesk
Autodesk

Dear Connor,

 

Thank you for your query.

 

I would suggest taking a look at the Revit API getting started material:

 

https://thebuildingcoder.typepad.com/blog/about-the-author.html#2

 

If you are in a hurry and want to skip everything else, you can just check out the hello world walkthroughs in the developer guide:

 

http://help.autodesk.com/view/RVT/2020/ENU/?guid=Revit_API_Revit_API_Developers_Guide_Introduction_G...

 

I hope this helps.

 

Best regards,

 

Jeremy

 



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

Message 5 of 6

Anonymous
Not applicable

Hi @jeremytammik

 

Firstly, I stated Novice Question in my post out of the hope that you would not waste any of your valuable time on it.

I have a lot of respect for you - not that I can comprehend the complexity of what you do, but rather that I have seen and appreciate your extensive blog resources and involvement within the Revit API community.

 

I've seen people complaining quite aggressively on the API forums and each time I've seen you respond very eloquently - its highly admirable.

 

Just to elaborate from a Revit API beginner's point of view:

I had to purge a bunch of families (including their nesteds) before adding them to our library.

 

I knew that a manual approach would be tedious. A quick Google took me to your blog post of Matt Taylor's code. His Read Me didn't help me and I was unable to decypher what it actually did. I had to try to guess how long it would take to automate the task, or if I would have to do it manually.

 

It is difficult to comprehend how long it would take to get the task at hand done by doing a bottom-up approach of learning all fundamentals first so I attempted a top-down approach of trying to run it first, seeing if it could work for what I need, and then trying to understand it.

 

I used the My First Plug-In tutorial which to my knowledge doesn't explicitly state that you should move the .dll file from Debug - I suppose your recommendations hence. Perhaps the sources should be consolidated to one resource: My First Plug-In could be integrated into the Revit Developers API Guide, so that one can work through them in chronological order? 

 

After getting the plug-in to work I have realised that a fair amount of work would still need to be done to shape it the way I want, and ended up doing it manually for now. But I've dipped my toes and am keen to get wet. Also, hopefully when the next novice doesn't go through the Developers Guide and has the same issue, they see the solution posted by @novesvalentin. Smiley Happy

 

Thanks again,

Connor

 

 

0 Likes
Message 6 of 6

jeremytammik
Autodesk
Autodesk

Dear Connor,

 

Thank you for your appreciation and glad to hear that you are keen to dig deeper into the Revit API sometime in the future.

 

Sorry to hear it turned out to be too much work this time around.

 

It might be easier to get started using either Revit macros or Dynamo rather than building and installing full-fledged add-ins.

 

Even creating an add-in is a very small and simple task if you are not confused by the nomenclature.

 

As mentioned above, the hello world walkthroughs in the developer guide show you the minimum required steps with a minimum of fuss:

 

http://help.autodesk.com/view/RVT/2020/ENU/?guid=Revit_API_Revit_API_Developers_Guide_Introduction_G...

 

Best regards,

 

Jeremy

 



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