Revit API

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

Revit 2013 PickObject

327 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: 112
Registered: ‎09-07-2012
Message 2 of 3 (322 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 (319 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
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.