Revit API

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

Revit 2013 PickObject

312 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: 98
Registered: ‎09-07-2012
Message 2 of 3 (307 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 (304 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
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.