Having problems with Revit add-inn mangers not working

Having problems with Revit add-inn mangers not working

sammgking
Explorer Explorer
781 Views
7 Replies
Message 1 of 8

Having problems with Revit add-inn mangers not working

sammgking
Explorer
Explorer

Hi all

 

I hoping someone might be able to help me understand why I cant seem to find an app manager that will work for 2022 (or any version).

 

I have tried Autodesk recommended downloads from Diroots and Stantec and both are giving their own specific issues. I am looking top use Dynamo somewhat and it seems that Dynamo isn't running quite right and i have reason to believe disabling my add-inns while using Dynamo may solve my issues.

 

Diroots is showing all my apps greyed out (and unable to enable/disable), and Stantec is saying 'unable rename add-inn'. See attached snapshots, including the Autodesk recommendation page.

 

Any help will be greatly appreciated, Many thanks

 

Screenshot 2024-01-18 175323.png

Screenshot 2024-01-18 175448.png

Screenshot 2024-01-18 175622.png

0 Likes
782 Views
7 Replies
Replies (7)
Message 2 of 8

ankofl
Advocate
Advocate

How about using  RevitAddInManager 1.5.2  ?

0 Likes
Message 3 of 8

sammgking
Explorer
Explorer

Thanks @ankofl

 

Seems to be a similar thing though. When I go to enable / disable, things seem to be greyed out.

Any ideas?

 

Screenshot 2024-01-19 101348.png

0 Likes
Message 4 of 8

ankofl
Advocate
Advocate

So you need the Application, not the Command. Please forgive me, I misunderstood you. Personally, this feature with enabling and disabling applications in AddinManager has never worked for me. That's partly why I'm trying to create my own AddinManager right now.

 

namespace em_Mark
{
    [Transaction(TransactionMode.Manual)]
    public class MarkerCommand : IExternalCommand
    {
        public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
        {
            string dllPath = @"R:\em_API\MyLibrary\MyLibrary.dll";
            string nameClass = "MyLibrary.MyClass";
            string nameMethod = "Execute";

            try
            {
                byte[] dllBytes = File.ReadAllBytes(dllPath);
                Assembly assembly = Assembly.Load(dllBytes);

                Type myClassType = assembly.GetType(nameClass);
                object myClassInstance = Activator.CreateInstance(myClassType);

                MethodInfo executeMethod = myClassType.GetMethod(nameMethod);
                object[] parameters = { commandData, message, elements };
                Result result = (Result)executeMethod.Invoke(myClassInstance, parameters);

                message = (string)parameters[1];
            }
            catch (Exception e)
            {
                TaskDialog.Show( $"{nameClass}.{nameMethod}", e.Message);
                return Result.Failed;
            }

            return Result.Succeeded;
        }
    }
}

 

This code finds the .dll file, reads bytes from it and instantly releases the file (unlike AddinManager, which simply copies the dll used to the address "User\AppData\Local\Temp\RevitAddins\" with the addition of the current time to the file name), which makes it possible to recompile the original one.the dll is right in the process of executing the program. Then it finds a class and a method in it, and calls it, and then accepts the response.
Maybe I'll make a separate post about it, in some foreseeable future.

0 Likes
Message 5 of 8

sammgking
Explorer
Explorer

What environment are you writing this in?

0 Likes
Message 6 of 8

ankofl
Advocate
Advocate

.Net Framework 4.8, Visual Studio 2022
Or is that not what you're talking about?

0 Likes
Message 7 of 8

ricaun
Advisor
Advisor

I suppose the problem is that your user does not have permission to edit the file.

 

If you run as admin probably gonna work.

 

By the way, the only thing that the add-in managers do is edit the file name, you can edit the .addin to .disable or another extension to force Revit to not see the file as a .addin.

Luiz Henrique Cassettari

ricaun.com - Revit API Developer

AppLoader EasyConduit WireInConduit ConduitMaterial CircuitName ElectricalUtils

Message 8 of 8

sammgking
Explorer
Explorer

@ricaun Thanks

 

Seems like just doing it manually might be the answer

0 Likes