How do I make add-in using out from opened document?

How do I make add-in using out from opened document?

XARMA
Advocate Advocate
207 Views
1 Reply
Message 1 of 2

How do I make add-in using out from opened document?

XARMA
Advocate
Advocate

I have saw some add-in that can be used without opening rvt file.

How do I make add-in using out from opened document?

I face some error message, If I execute my dll file eventhough any simple codes it is.

Syetem.NullReferenceException: Object reference not set to an instance of an object at A.Command.Execute(ExternalCommandData commandData, String& message, ElementSet elements) at ...

0 Likes
Accepted solutions (1)
208 Views
1 Reply
Reply (1)
Message 2 of 2

naveen.kumar.t
Autodesk Support
Autodesk Support
Accepted solution

Hi @XARMA ,

 

If you want logic that runs when Revit starts (before any file is opened), implement IExternalApplication and use OnStartup:

public class MyApp : IExternalApplication
{
    public Result OnStartup(UIControlledApplication application)
    {
        // Add UI or run logic here
        return Result.Succeeded;
    }

    public Result OnShutdown(UIControlledApplication application)
    {
        return Result.Succeeded;
    }
}


Also, please take a look at the links 

https://help.autodesk.com/view/RVT/2024/ENU/?guid=Revit_API_Revit_API_Developers_Guide_Introduction_... 

If this doesn't help, Could you please explain your issue in more detail?


Naveen Kumar T
Developer Technical Services
Autodesk Developer Network

0 Likes