The path to load the Bundle file

The path to load the Bundle file

dungthachbomay
Contributor Contributor
302 Views
2 Replies
Message 1 of 3

The path to load the Bundle file

dungthachbomay
Contributor
Contributor

Hello! 

I am programming Revit API with C# and I am preparing to create a ribbon, I have a question as follows:

- Suppose I installed Revit on the "D" drive, will the "C: \ ProgramData \ Autodesk \ Applicationplugins" path exist?

- In case (maybe not happening) is my computer or customers intentionally without the "C" drive, "Autodesk \ Applicationplugins" lies in which path?

 

- Can someone help me!  Thank you very much

0 Likes
Accepted solutions (1)
303 Views
2 Replies
Replies (2)
Message 2 of 3

jeremy_tammik
Alumni
Alumni

You can determine details of the Revit installation from the registry. The Revit SDK includes a tool for that, the RevitAddinUtility. Furthermore, @ricaun  built and shared a replacement for that utility named Autodesk.PackageBuilder

   

    

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
Message 3 of 3

ricaun
Advisor
Advisor
Accepted solution

Revit basically search in the two folder for the ApplicationPlugins.

 

Current User - %AppData%/Autodesk/ApplicationPlugins
All Users    - %ProgramData%/Autodesk/ApplicationPlugins

 

The %ProgramData% usually is the C:\ProgramData\ and I guess the drive C is where the windows is installed.

 

In code would be something like:

private const string RevitApplicationPluginsFolder = "\\Autodesk\\ApplicationPlugins\\";
/// <summary>
/// Get AllUsers ApplicationPlugins Folder
/// </summary>
/// <returns></returns>
public static string GetAllUsersApplicationPluginsFolder()
{
    return Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + RevitApplicationPluginsFolder;
}
/// <summary>
/// Get CurrentUser ApplicationPlugins Folder
/// </summary>
/// <returns></returns>
public static string GetCurrentUserApplicationPluginsFolder()
{
    return Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + RevitApplicationPluginsFolder;
}

 

The Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) return the C:\ProgramData\ folder.

 

Luiz Henrique Cassettari

ricaun.com - Revit API Developer

AppLoader EasyConduit WireInConduit ConduitMaterial CircuitName ElectricalUtils