Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

As running plug-in only from Revit 2014

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
Anonymous
394 Views, 3 Replies

As running plug-in only from Revit 2014

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

3 REPLIES 3
Message 2 of 4
jeremytammik
in reply to: Anonymous

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

Message 3 of 4
Anonymous
in reply to: jeremytammik

Hi jeremy


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

Message 4 of 4
jeremytammik
in reply to: Anonymous

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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Rail Community