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: 

Casting - Definition

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
J33C316
694 Views, 2 Replies

Casting - Definition

Newbie question... Can someone help me to understand casting? I've been through the tutorials but still don't have a grip on it. Thanks.

2 REPLIES 2
Message 2 of 3
Sean_Page
in reply to: J33C316
Message 3 of 3
RPTHOMAS108
in reply to: J33C316

I saw this the other week but maybe from below more will understand a specific benefit of not casting:

 

Element.Name = Read/Write property

ElementType.Name = WriteOnly property

 

Everything that then inherits from ElementType e.g. FamilySymbol gets the same limited property access.

 

Would also suggest overriding .ToString with Name since .ToString is  the final fall back in WPF binding. Suggestion as idea added below.

 

https://forums.autodesk.com/t5/revit-ideas/revit-api-override-tostring-with-element-name/idi-p/96584...

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

Post to forums  

Rail Community


Autodesk Design & Make Report