Message 1 of 5

Not applicable
04-12-2018
01:44 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello Mohammad,
As far as I know, they should be the same. A Family contains several element types in it. When you insert a type (element) in the project, you are inserting an instance of that type. This means you can place several instances of the same type (element). So, you can either obtain the Id of an Element using the Id method or GetTypeId method.
Why sometimes the GetTypeId returns null is explained in here: http://www.revitapidocs.com/2015/cc66ca8e-302e-f072-edca-d847bcf14c86.htm
Cheers
Ruben
The Element ID and Type ID are two different things. As explained above, there are family instances and family types.
The element's Type ID will return you the a Family Type object, which can be used to carry out operations that require access to the element's type and not the instance.
For example, a FamilyInstance's instance parameters can be accessed via the FamilyInstance itself (using doc.GetElement(myInstanceId)) but its type parameters need to be accessed via the FamilyInstance's Family Type - this is where the element's TypeID comes into play.
Thank you guys, that answered my question @Anonymous @Anonymous
Element Id is the ID of Element at instance which will be different for each and every elements used in the project(family instance)
whereas TypeID is the ID of type of the element(family).
for ex.
if we place single flush door(36'' x 84") at many instances,the elementid of each door will be different whereas TypeID of singleflushdoor will be same at all instances.