BHoM / BHoM_Adapter

GNU Lesser General Public License v3.0
7 stars 5 forks source link

BHoM_Adapter: Always update ids, even if present before #208

Closed IsakNaslundBh closed 4 years ago

IsakNaslundBh commented 4 years ago

Description:

The AssignIds method only sets new ids to objects if they do not have any before. This is causing issues when you have pulled some objects from a specific software, and then want to push these objects to a new model, with some pre-existing elements, as the ids then might overlap, causing elements to be pushed wrongly.

This can be even more problematic for objects, such as Bars, that depend on their Nodes for positional information, causing the Bars to come in with wrong coordinates.

Suggestion to remove check for pre-existing ids when assigning new, and changing to ALWAYS assign new ids. This method is only applied on objects that are going to be created, not updated, so should be seen as new objects anyway, and should thereby be given a new id, made sure not pre-existing in the model anyway.

Steps to reproduce:

Pull elements from a model, and try to push them to a new model with some pre-existing elements.

Expected behaviour:

See above.

Test file(s):

@kThorsager do you have a link to Robot files giving you problems?

alelom commented 4 years ago

The proposal seems reasonable and I agree with this.