Element ID and Element type Id

Element ID and Element type Id

Anonymous
Not applicable
4,689 Views
4 Replies
Message 1 of 5

Element ID and Element type Id

Anonymous
Not applicable

Hey all,

 

can anybody tell what is the difference ?

 

Regards,

0 Likes
Accepted solutions (1)
4,690 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable
Accepted solution

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

Message 3 of 5

Anonymous
Not applicable

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. 

 

 

Message 4 of 5

Anonymous
Not applicable

Thank you guys, that answered my question @Anonymous @Anonymous

 

0 Likes
Message 5 of 5

Anonymous
Not applicable

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.