iTwin / imodel-transformer

API for exporting an iModel's parts and also importing them into another iModel
MIT License
3 stars 2 forks source link

IModelCloneContext.findTargetEntityId fixed relationship id finding #60

Closed simsta6 closed 1 year ago

simsta6 commented 1 year ago

I had to change Id64.isInvalid to !Id64.EntityReferences, because Id64.isInvalid sees "e0" as valid id. image

The problem was, that IModelCloneContext was trying to find relationship's target or source element that does not exist in the target iModel. So when findTargetEntityId returns "e0" for element referenced by relationship it would pass if statement with Id64.isInvalid and transformer would crash because ECSqlStatement.bindId can't bind invalid64Id.

Now IModelCloneContext.findTargetEntityId will return invalid id for target iModel relationship.