Revit API

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

Revit 2013 PickObject

303 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

Valued Contributor
Revitalizer
Posts: 87
Registered: ‎09-07-2012
Message 2 of 3 (298 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 (295 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!

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 or visit the Installation and Licensing Forum to get help installing your software.