Revit API

Reply
Active Member
joostschlebaum
Posts: 8
Registered: ‎09-30-2010
Message 1 of 3 (321 Views)
Accepted Solution

Revit 2013 PickObject

321 Views, 2 Replies
10-31-2012 04:18 AM

Hi,

 

The API PickObject function doesn't work anymore with Revit 2013.

I tried to edit the code with help of the migrating blog post of Jeremy's, but without succes.

 

This is the code:

 

                        SheetFilter selFilter = new SheetFilter();
                        Selection sel = uiapp.ActiveUIDocument.Selection;
                        pickedRef = sel.PickObject(ObjectType.Element, selFilter, "Select sheet.");

                        Element elema = pickedRef.Element;

 Its the pickedRef.Element; wich gives me an error.

Does someone know how to fix this?

Thanks!

 

Regards,

 

Joost

 

Hi Joostschlebaum,

 

in Revit 2011 and 2012, yourReference.Element can be used,

in 2013, you need to use

yourDocument.GetElement(yourReference.ElementId).

 

 

Cheers,

 

Revitalizer

Distinguished Contributor
Revitalizer
Posts: 110
Registered: ‎09-07-2012
Message 2 of 3 (316 Views)

Re: Revit 2013 PickObject

10-31-2012 05:17 AM in reply to: joostschlebaum

Hi Joostschlebaum,

 

in Revit 2011 and 2012, yourReference.Element can be used,

in 2013, you need to use

yourDocument.GetElement(yourReference.ElementId).

 

 

Cheers,

 

Revitalizer

Active Member
joostschlebaum
Posts: 8
Registered: ‎09-30-2010
Message 3 of 3 (313 Views)

Re: Revit 2013 PickObject

10-31-2012 05:44 AM in reply to: joostschlebaum

Hi Revitalizer,

 

That's the key! Awesome!

Thank you very much sir!

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!