Is it possible to set or renumber Element IDs so it starts with specific value?
Like start all elements with 100000 similar as it is with file position which starts with 4000000?
Hi Oto,
Oto said:as it is with file position which starts with 4000000?
I am not sure whether file position starts with this number. The file position is in-memory information, not persisted anywhere, valid only "right now", which is different from ElementID. But, it's true I never check the value, because in API, it was (because file position is quite obsolete concept and is used rarely) like to receive it in one function and to pass it to another.
Oto said:Like start all elements with 100000
ElementID is 8 bytes number, persisted in DGN V8 format, incremented automatically when a new element is added. So it starts from 1 (I guess) and just counting up.
Oto said:Is it possible to set or renumber Element IDs so it starts with specific value?
No.
I even think that there is no API how to access ElementID in read-write mode. I can imagine to create a new file, copy at first all settings from the source one, fill the rest to the defined "start ID" by some dummy elements and copy source elements one by one.
But, what can be an advantage of such change? ElementID is similar to identity number in SQL database: The important feature is not value, but that it is unique and does not change during record lifetime.
With regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Jan Šlegr said:The important feature is not value, but that it is unique and does not change during record lifetime.
Exactly but could hold additional value. What I am looking for is a workaround in case adding it as Items doesn't work in the workflow.
Idea is to have number for each file which is unique in each file but also for many files from one supplier.
Oto said:Idea is to have number for each file which is unique in each file but also for many files from one supplier.
Often these types of request are solved creating GUID from file (source) ID and element ID.
I can imagine "file ID" or "model ID" (what is better for this specific purpose) can be stored in DGN file as application data or as hidden EC data (both can be done using API) and used when "unique ID" is necessary.
Moving the elements looks more complicated to me, but both solutions require some coding and application support.
Regards,