Revit Architecture Forum
Welcome to Autodesk’s Revit Architecture Forums. Share your knowledge, ask questions, and explore popular Revit Architecture topics.
abbrechen
Suchergebnisse werden angezeigt für 
Anzeigen  nur  | Stattdessen suchen nach 
Meintest du: 

Way to solve duplicate element IDs in different revit files?

20 ANTWORTEN 20
GELÖST
Antworten
Nachricht 1 von 21
Anonymous
5204 Aufrufe, 20 Antworten

Way to solve duplicate element IDs in different revit files?

Hello all,

 

I have modeled different storeys of a structure in different revit files, but after finishing all of them, I have to combine them all in another software; however, I found out that some elements of one revit file have same element IDs as that of other revit file. Therefore, I would highly appreciate if anyone can suggest a way to solve this issue.

 

I checked but it seems that I can not change element IDs. I am looking forward to your ideas, suggestions and recommendations. Thanks!

 

Best regards,

20 ANTWORTEN 20
Nachricht 2 von 21
barthbradley
als Antwort auf: Anonymous


Interesting question.  How/why does it matter?  

Nachricht 3 von 21
Anonymous
als Antwort auf: barthbradley

Actually, I need the whole structure's model to be simulated in another software. The simulation software recognizes each element through its element ID, but since I have created models of different storeys of the structure in different revit files, there are duplicate element IDs, which create issue in giving me a complete structure in my simulation software. If I can change those duplicate element IDs in one of the revit files and remove the duplication, this issue would be solved. Other solutions are also welcomed.

Nachricht 4 von 21
barthbradley
als Antwort auf: Anonymous

May I ask what software it is? 

Nachricht 5 von 21
Anonymous
als Antwort auf: barthbradley

Actually, that simulation software has just been developed and is being tested before its launch in the market. This software has to simulate a construction process. The most important point is that this software identifies each element through its element ID and duplication of element IDs is a serious issue atm.

Nachricht 6 von 21
ToanDN
als Antwort auf: Anonymous


@Anonymous wrote:

Actually, that simulation software has just been developed and is being tested before its launch in the market. This software has to simulate a construction process. The most important point is that this software identifies each element through its element ID and duplication of element IDs is a serious issue atm.


Then now is the perfect time to fix the software so that it can deal with duplicate Element IDs when it launches.

Nachricht 7 von 21
Anonymous
als Antwort auf: ToanDN

That is technically not possible for various reasons. Issues arising from duplicate elements can be solved, but issues arising from duplicate element IDs are quite complex because the duplication of IDs can be between completely different elements in numbers as large as thousands.

Nachricht 8 von 21
barthbradley
als Antwort auf: Anonymous

ElementId id = e.GetTypeId();

ElementType type = doc.GetElement( id )
as ElementType;

 

How'd I do? 

 

 

 

Nachricht 9 von 21
ToanDN
als Antwort auf: Anonymous


@Anonymous wrote:

That is technically not possible for various reasons. Issues arising from duplicate elements can be solved, but issues arising from duplicate element IDs are quite complex because the duplication of IDs can be between completely different elements in numbers as large as thousands.


If it is impossible to fix it for a software under development then how do you think the end-users with limited or no access to the source codes of Revit be able to fix it?

 

Nachricht 10 von 21
Anonymous
als Antwort auf: barthbradley

If I understood your point, you are suggesting to incorporate element type as well for accurate recognition, but the issue is that element ID is more unique than element type. So, there are many duplicate elements with the same element types; hence, I think that this would not work out in this case.

Nachricht 11 von 21
Anonymous
als Antwort auf: ToanDN

You are right, but somehow, there is technically not much that we can do in this case considering the limitations of revit itself. This  software has to identify every element in the model and the number of elements can be as high as hundreds of thousands. So, the element IDs are the only identifiers that we can use to achieve this identification purpose. This duplication does not usually occur if we model the whole structure in 1 revit file, but that is also not possible because of the huge size of structure.  Therefore, we need a way out of this issue.

Thanks for your input. 

Nachricht 12 von 21
ToanDN
als Antwort auf: Anonymous

Think about it like a city, districts, quarters, streets, house numbers. There are many houses with the same number but if they are on different streets then they are still unique. This sort of basic hierachy identification has existed for thousands of year.

For your program, you need to find another or some others ids such as FileBinaryID amd append it or them to the ElementIDto create something unique.
Nachricht 13 von 21
Anonymous
als Antwort auf: ToanDN

Can we append other IDs to element IDs in revit? Or is there any way we can get rid of this duplication before importing the revit models into our simulation software?

 

 

Nachricht 14 von 21
RobDraw
als Antwort auf: Anonymous

Why not combine the models? That should make every ID unique.

 

I'm with the others. Since element IDs are an arbitrary number, the software needs a better way to handle them when multiple models are used. Until then your software is going to be limited to just one model.


Rob

Drafting is a breeze and Revit doesn't always work the way you think it should.
Nachricht 15 von 21
loboarch
als Antwort auf: Anonymous

Cut and then paste aligned to the same position. This will change the Element ID of the object, because you are basically making a "new" element.



Jeff Hanson
Principal Content Experience Designer
Revit Help |
Nachricht 16 von 21
L.Maas
als Antwort auf: Anonymous

You might consider using UniqueID/GUID which is exposed through the API

UniqueID.PNG

 

 

The Revit ID is more or less just a counter. Every new item gets a number based on the last number + 1

As you noticed the numbers between documents can be the same.

 

UniqueID should work better between documents, but not foolproof. For example if you would copy your project to a new file the elements in the model retain their IDs (as expected). When reading information from both files you will still see the same numbers. But models that have been created separately should be OK.

 

A good source for you might be the building coder which deals with the Revit API. For example THIS post on IDs 

Also the Revit API forum might be a good source to ask questions and find answers.

 

 

Louis

EESignature

Please mention Revit version, especially when uploading Revit files.

Nachricht 17 von 21
ToanDN
als Antwort auf: Anonymous


@Anonymous wrote:

Can we append other IDs to element IDs in revit? Or is there any way we can get rid of this duplication before importing the revit models into our simulation software?

 

 


I think it would be better for you to take care of it in the software, not in the source files, so that the software can work with various formats from different programs.  Something like generating random numbers and assign them to imported elements.  Not sure what programming language you are using but Python and Java can do it and I have no doubt others can as well.

Nachricht 18 von 21
Anonymous
als Antwort auf: ToanDN

Thank you ToanDN for your creative input. We do need to make changes in the software.

Nachricht 19 von 21
Anonymous
als Antwort auf: L.Maas

Thank you L.Maas for your input. UniqueIDs are indeed better than element IDs.

Nachricht 20 von 21
Anonymous
als Antwort auf: RobDraw

Yes, you are right. The software needs to be changed to resolve this issue.

Sie finden nicht, was Sie suchen? Fragen Sie die Community oder teilen Sie Ihr Wissen mit anderen.

In Foren veröffentlichen  

Autodesk Design & Make Report