Revit.INI File Issues
Friday, February 19th, 2010This post is technical.
If that’s not your cup of tea, move along. Nothing to see here.
For two full days, I struggled with this issue. I was trying to add a custom ‘add-in’ to Revit Architecture 2010. I built my custom add-in dll with Visual Studio, and followed the steps to modify the Revit.ini file so that my add-in would be loaded when Revit starts. Despite following the instructions meticulously…failure. The INI file was rewritten. My changes were tossed out and Revit recreated the INI file from scratch.
Follow instructions again. Failure. Uninstall Revit. Reinstall Revit…failure.
Repeat the above process complete with hair pulling and eye poking for two full days. At last, I broke down. I decided to make use of our Autodesk Developer Network membership and ask for help.
In just a few hours, the kind folks over at ADN Support sent a link to this knowledgebase article, where someone else was describing my exact problem, and the solution. And it was so simple.
Issue
I modified the Revit.ini file to add information about my addin and now Revit keeps rewriting Revit.ini on every startup and so my addin does not load. What could be the problem?
Solution
If you compare your modified Revit.ini file with the original one in a binary viewer then you can see that the UTF-8 BOM (Byte Order Mark) is missing from the beginning of your file – possibly the text editor you used did not write out that part -, and so Revit finds the file corrupt. If you modify your file in Notepad then it should add the missing bit and it should work again.
After reading this, I added my external command to the Revit.ini file in Notepad and, sure enough, works like a charm.
I post this in the hope that it may save someone else the frustration that I had to go through.
