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: 

The addin command did not respond

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

The addin command did not respond

I have write a simple addin for Revit2017 using C++/CLR, Here is the code:

 

The .h file ClassLibrary3.h:

 

 

#pragma once

using namespace System;
using namespace System::Windows::Forms;
using namespace System::Collections;

using namespace Autodesk::Revit;
using namespace Autodesk::Revit::DB;
using namespace Autodesk::Revit::UI;

namespace ClassLibrary3 {

	[Autodesk::Revit::Attributes::Transaction(Autodesk::Revit::Attributes::TransactionMode::Manual)]
	public ref class Class1 : IExternalCommand
	{
	public:
		virtual Result Execute(ExternalCommandData ^ commandData, String ^% message, ElementSet ^ elements) sealed;
	};
}

 

 

The .cpp file is:

 

#include "stdafx.h"

#include "ClassLibrary3.h"

namespace ClassLibrary3 
{
	Result Class1::Execute(ExternalCommandData ^ commandData, String ^% message, ElementSet ^ elements)
	{
		MessageBox::Show("executed");
		return Result::Succeeded;
	}
}

 

 

 

 

The ClassLibrary3.addin:

 

<?xml version="1.0" encoding="utf-8"?>
<RevitAddIns>
  <AddIn Type="Command">
    <Assembly>D:\temp\ClassLibrary3\Debug\ClassLibrary3.dll</Assembly>
    <ClientId>183C607F-4873-4A6D-BE89-0E0357A05F8C</ClientId>
    <FullClassName>ClassLibrary3.Class1</FullClassName>
    <Text>ClassLibrary3</Text>
    <Description>ClassLibrary3</Description>
    <VisibilityMode>AlwaysVisible</VisibilityMode>
    <VendorId>BIMTECH</VendorId>
    <VendorDescription>BIMTECH</VendorDescription>
  </AddIn>
</RevitAddIns>

 

 

The addin is loaded successfully by Revit 2017 and appeared in the External Tools menu.

My problem is that Revit did not respond when I chose to execute the addin command in the menu, why?

It looks like the Class1 :: Execute function is not executed at all

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

I think you need to use c#, VB. Net, f# supported net api
Message 3 of 4
Anonymous
in reply to: sonicer

But the same code can run normally on Revit 2016.

Message 4 of 4
Anonymous
in reply to: Anonymous

The problem is that the DLL version does not match.

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

Post to forums  

Forma Design Contest


Rail Community