As running plug-in only from Revit 2014

As running plug-in only from Revit 2014

Anonymous
Not applicable
498 Views
3 Replies
Message 1 of 4

As running plug-in only from Revit 2014

Anonymous
Not applicable

Hi everyone

I developed a plug-in for Revit 2014 using Visual Studio .NET 2012. this plug-in runs in revit 2014 without problems.the installer saves  the plug-in components in the folder "Program Files\My_Plugin\" and copy two files (.dll and .addin) to the path ..... appdata\roaming\autodesk\revit\addin\2014\. If I copy the files from the path "appdata\roaming\autodesk\revit\addin\2014\" to the folder 2013, my plugin runs without problems in Revit 2013. As running my plug-in only from Revit 2014?

 

Regards

0 Likes
Accepted solutions (2)
499 Views
3 Replies
Replies (3)
Message 2 of 4

jeremytammik
Autodesk
Autodesk
Accepted solution

Dear Marcos Mateo,

 

Sorry, the end of your message seems garbled to me. Can you please clarify what you mean?

 

Or rather, maybe I can guess: do you wish your add-in to run only in Revit 2014, and be disabled in all other versions of Revit?

 

That can be easily achieved.

 

Simply implement an external application and check the Revit version in the OnStartup method.

 

If you are not happy with it, you can cancel the loading operation.

 

Best regards,

 

Jeremy



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

0 Likes
Message 3 of 4

Anonymous
Not applicable

Hi jeremy


Thanks, that is what I need. There is an example in Visual Basic NET 2012 to do this?

0 Likes
Message 4 of 4

jeremytammik
Autodesk
Autodesk
Accepted solution

Sure.

 

Look at 

 

https://github.com/jeremytammik/AdnRme

 

More specifically, at the external application implementation:

 

https://github.com/jeremytammik/AdnRme/blob/master/AdnRme/App.cs

 

Look at the OnStartup method:

 

  public Result OnStartup( UIControlledApplication a )
  {
    // only create a new ribbon panel in Revit MEP:

    ProductType pt = a.ControlledApplication.Product;

    //if( ProductType.MEP == pt ) // 2012

    if( ProductType.MEP == pt 
      || ProductType.Revit == pt ) // 2013
    {
      AddRibbonPanel( a );
      return Result.Succeeded;
    }
    return Result.Cancelled;
  }

 

Cheers,

 

Jeremy



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

0 Likes