Revit API

Reply
Active Member
Kevin133
Posts: 7
Registered: ‎09-28-2012
Message 1 of 4 (188 Views)

Add-in program update from 2009 API to 2012 API

188 Views, 3 Replies
09-28-2012 03:19 AM

Hello,

 

I am updating an external function (add-in) using in Revit 2009 to 2012. After I have copied the new RevitAPI.dll and RevitAPIUI.dll into my solution, I find that many functions belong to different library with comparing in 2009 API.

 

I spend some time to resolve the library of the function, for example (If I am wrong please tell me, thank you
):

 

Autodesk.Revit.IExternalCommand  =>   Autodesk.Revit.UI.IExternalCommand

Autodesk.Revit.IExternalCommand.Result  =>  Autodesk.Revit.UI.Result

Autodesk.Revit.ElementSet  =>  Autodesk.Revit.DB.ElementSet

Autodesk.Revit.Document =>  Autodesk.Revit.DB.Document

Autodesk.Revit.Elements.ExternalCommandData  =>  Autodesk.Revit.DB.ExternalCommandData

etc...

 

But there are some functions I cannot find its new library, please tell me how to update them, thank you.
The unchanged part is:

 

            Autodesk.Revit.Filter filter;
            Autodesk.Revit.Creation.Application create;
            create = cmdData.Application.Create;         
            filter = create.Filter.NewTypeFilter(typeof(Grid));

 

Thanks a lot,

Kevin

Contributor
zhangle
Posts: 19
Registered: ‎07-05-2009
Message 2 of 4 (185 Views)

Re: Add-in program update from 2009 API to 2012 API

09-28-2012 09:28 AM in reply to: Kevin133

have a look of the following in the 2013 API chm documentation: 

Autodesk.Revit.Creation namespace - Document class 

Autodesk.Revit.DB namespace - FilteredElementCollector class 

 

Active Member
Kevin133
Posts: 7
Registered: ‎09-28-2012
Message 3 of 4 (165 Views)

Re: Add-in program update from 2009 API to 2012 API

10-03-2012 03:09 AM in reply to: zhangle

Thanks for the reply.

 

I have read some documents said that there is a large change when in the revit API 2011, where the Document.Elements collection, the Document.get_Elements( type ) and the filter mechanism have all been removed.

 

Should I use the FilteredElementCollection class and its element to re-write the add-in?

 

Thank you very much

ADN Support Specialist
augusto.goncalves
Posts: 312
Registered: ‎04-30-2009
Message 4 of 4 (150 Views)

Re: Add-in program update from 2009 API to 2012 API

10-04-2012 10:44 AM in reply to: Kevin133

Hi,

 

FilteredElementCollectior is the way to get elements on a Revit project. You can find a good overview here: http://thebuildingcoder.typepad.com/blog/2010/04/collector-benchmark.html

 

Hope this help. Migrating from 2009 will take some time, specially due the changes from 2010 to 2011, but it can be a good change to improve your application with the new APIs.

 

Regards,



Augusto Goncalves
Autodesk Developer Network

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community


Revit Exchange Apps

Created by the community for the community, Autodesk Exchange Apps for Revit helps you achieve greater speed, accuracy, and automation from concept to manufacturing.

Connect with Revit

Twitter

Facebook

Blogs

Youtube