Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Revit 2013 PickObject

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
joostschlebaum
516 Views, 2 Replies

Revit 2013 PickObject

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

 

2 REPLIES 2
Message 2 of 3

Hi Joostschlebaum,

 

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

in 2013, you need to use

yourDocument.GetElement(yourReference.ElementId).

 

 

Cheers,

 

Revitalizer




Rudolf Honke
Software Developer
Mensch und Maschine





Message 3 of 3

Hi Revitalizer,

 

That's the key! Awesome!

Thank you very much sir!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Rail Community