Revit App publishing Issue

Revit App publishing Issue

Anonymous
Not applicable
731 Views
5 Replies
Message 1 of 6

Revit App publishing Issue

Anonymous
Not applicable

 

Hello, I want to publish revit app in autodesk app store.There is one question about publishing, that when we create an application we create a ribbon on autodesk revit using api.

 

I also create a ribbon in revit using api, also give logo for that ribbon. Using following code I create a ribbon and mention the path of the logo which is already stored in my pc.

 

 

 

            RibbonPanel ribbonPanel = application.CreateRibbonPanel("Geometry");
            string thisAssemblyPath = Assembly.GetExecutingAssembly().Location;
      
            PushButtonData bOne = new PushButtonData("ButtonNameA", "Quick Join",
            thisAssemblyPath, "QuickJoin.Class1");
            bOne.LargeImage =
               new BitmapImage(new Uri(@"E:\TECHTURE\FINAL ADD-INS BACKUPS\QuickJoin\QuickJoin\bin\Debug\logo.png"));
         
            PushButton pushButton = ribbonPanel.AddItem(bOne) as PushButton;

 

 

While publishing app they give facility for giving logo to the app. Then I want to remove the path of logo from the code.It automatically gibe logo to the ribbon..

 

 

 

 

0 Likes
732 Views
5 Replies
Replies (5)
Message 2 of 6

Anonymous
Not applicable

The Apps Exchange has me put my support files in a folder called "Resources" under the main app folder. In your case it would be something like this:

 

= new Uri(Path.Combine(Path.GetDirectoryName(thisAssemblyPath), "Resources", "LOGO.PNG");

 

(I would recommend doing all your testing with all your files exactly where your final user will have them.)

0 Likes
Message 3 of 6

Anonymous
Not applicable

Its working..One more question how to write addin file?

 

I written addin file this is ok or I want to make changes in addin file for exchanging app.

 

<?xml version="1.0" encoding="utf-8"?>
<RevitAddIns>
  <AddIn Type="Application">
    <Name>XYZ</Name>
    <Assembly>D:\XYZ\XYZ\bin\Debug\XYZ.dll</Assembly>
    <AddInId>fd44aa61-5aa8-4508-9937-4e971415fa75</AddInId>
    <FullClassName>XYZ.Ribbon</FullClassName>
    <VendorId>XYZ</VendorId>
    <VendorDescription>XYZ</VendorDescription>
  </AddIn>
</RevitAddIns>

 

 

0 Likes
Message 4 of 6

Mustafa.Salaheldin
Collaborator
Collaborator

The assembly path should be relative not absolute.


¯\_(ツ)_/¯
Let it work like a charm.

Mustafa Salaheldin


EESignature




Digital Integration Manager, DuPod

Facebook | Twitter | LinkedIn

0 Likes
Message 5 of 6

Anonymous
Not applicable

Then how to give relative path? if we don't know that the executable file in which path.

0 Likes
Message 6 of 6

CoderBoy
Advocate
Advocate

Your add-in should be installed in a folder within the Revit add-ins folder (or at the very least on the same drive).  For example, if the add-ins folder is here:

 

C:\ProgramData\Autodesk\Revit\Addins\2017

 

and your add-in DLL is installed in this subfolder of that folder:

 

C:\ProgramData\Autodesk\Revit\Addins\2017\CTC-BIM-Project-Suite.bundle\Contents

 

Your add-in file might look like this:

 

<?xml version="1.0" encoding="utf-8"?>
<RevitAddIns>
<AddIn Type="Application">
<Name>CTC BIM Project Suite</Name>
<Assembly>CTC-BIM-Project-Suite.Bundle\Contents\CTC.RET.ProjectSuiteExternalApp2017.dll</Assembly>
<AddInId>6066cbf8-9234-41dd-a2a6-c5762d1263ff</AddInId>
<FullClassName>CTC.RET.SuiteExternalApp.App</FullClassName>
<VendorId>CTC</VendorId>
<VendorDescription>CAD Technology Center, Inc. www.cadtechnologycenter.com</VendorDescription>
</AddIn>
</RevitAddIns>

 

So the path to the DLL is specified as relative to the location of the add-in file, wherever that add-in file is located.

 

Hope that helps.

 

.

0 Likes