Announcements

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

Can't obtain MacroManager

WhiteSharx
Contributor

Can't obtain MacroManager

WhiteSharx
Contributor
Contributor

Hello everybody!

 

I'm stuck with getting MacroManager object. There are much more class members listed in API reference then really available.

What am I doing wrong?

 

untitled.png

 

Or is there any other way to delete all macros from document?

0 Likes
Reply
Accepted solutions (1)
868 Views
8 Replies
Replies (8)

jeremytammik
Autodesk
Autodesk

I should think this can be done quite easily.

 

Look at What's New in the Revit 2014 API:

 

http://thebuildingcoder.typepad.com/blog/2013/04/whats-new-in-the-revit-2014-api.html

 

Search for 

 

MacroManager API

 

 

Cheers,

 

Jeremy



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

0 Likes

WhiteSharx
Contributor
Contributor

Dear Jeremy!

I looked through your link and its still not obvious to me what's wrong.

I really tried using different namespaces (Autodesk.Revit.DB.Macros and Autodesk.Revit.UI.Macros).

Is it possible that something changed since 2014 API? I'm using Revit 2016 and Visual Studio 2013 (.Net 4.5 framework). May be some kind of attribute could be the reason..

Would you be so kind to try it yourself? If you are succesfull at it then it's got to be mine PC problem

 

By the way, have you seen this topic http://forums.autodesk.com/t5/revit-api-forum/automatic-space-creation-problem/td-p/6553375 ?

 

Thanks in advance!

0 Likes

Revitalizer
Advisor
Advisor
Accepted solution

Hi,

 

add "RevitAPIMacros.dll" to your VS project.

 

 

Revitalizer




Rudolf Honke
Software Developer
Mensch und Maschine





WhiteSharx
Contributor
Contributor

Revitalizer, thank you very much!

It's got to be that easy I knew it )

Actually, a reference to "RevitAPIMacrosInterop.dll" solved the problem at last (not to RevitAPIMacros.dll)!

0 Likes

Revitalizer
Advisor
Advisor

Hi,

 

I cannot believe that RevitAPIMacrosInterop.dll solves the problem since it does not contain the MacroManager definition.

But RevitAPIMacros.dll does:

 

Macro.png




Rudolf Honke
Software Developer
Mensch und Maschine





0 Likes

jeremytammik
Autodesk
Autodesk
0 Likes

Revitalizer
Advisor
Advisor

Hi Jeremy,

 

BuildingCoder.csproj confirms my assumption.

 

 

Bye,

Rudi




Rudolf Honke
Software Developer
Mensch und Maschine





0 Likes

jeremytammik
Autodesk
Autodesk

Dear Rudi,

 

Yes, absolutely.

 

I was forced to add RevitAPIMacros.dll and RevitAPIUIMacros.dll specifically for this command.

 

I published our discussion now as a blog post as well for future reference and better readability:

 

http://thebuildingcoder.typepad.com/blog/2016/09/macromanager-materials-kiss-and-getting-started.htm...

 

Thank you both for raising and solving this!

 

Cheers,

 

Jeremy



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

0 Likes