Message 1 of 7

Not applicable
10-21-2018
06:50 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi everyone,
I am starting with some first Revit add in and one thing I am concerned is how to create the relative path for my icon url for my add in as following code:
// Determine the data for a push button, include the name of the command to execute PushButtonData pushButtonData51 = new PushButtonData("DetachModels", "DetachModels", thisAssemblyPath, "CherryBIMservices.BatchDetachedModel"); //Add push button to the ribbon panel PushButton pushButton51 = ManagePanel.AddItem(pushButtonData51) as PushButton; // Add a tool tip for a button pushButton51.ToolTip = "Batch detach models"; // Add URL of image, set as Bitmap and set the image as the icon for the pushbutton Uri uriImage51 = new Uri(@"C:\ProgramData\Autodesk\Revit\Addins\2017\CherryBIMservices\51.png"); BitmapImage bitmapImage51 = new BitmapImage(uriImage51); pushButton51.LargeImage = bitmapImage51;
My question is how to replace the path : "
C:\ProgramData\Autodesk\Revit\Addins\2017\CherryBIMservices\51.png
by relative path.
Thank you so much for your help.
Best Regards,
Cherry Truong
Solved! Go to Solution.