Persistent_id repeat in different entity and vary in different version of Sketchup

I met some inexplicable bugs when trying developing an extension of Sketchup. During the process of debugging, I find that there are some strange problems with the model.

When I open it with su 2020 and select a group, its persistent_id is showed as 145313, but I can find another edge with same persistent_id by “model.find_entity_by_persistent_id”. As a result, a group and an edge have same persistent_id, which call some crashes to my program.

However, when I open it with su 2021, its persistent_id is showed as 3132761, and everything goes well.

More details are showed in the two screenshots. Is there any way to solve the problem in su 2020?

Changed the category to Developers.

Pay attention to the API Release Notes:
File: Release Notes — SketchUp Ruby API Documentation

… I did look through it quickly but did not see a specific entry related to duplicate persistent IDs.

Update to SU2021 :wink:

SketchUp 2021 Application Release Notes talks about improved validity checking that solved many model corruption issues.

So if you read these release notes, you’ll see that SU2021 will silently fix many more model issues.

Fixing in SU2020? Perhaps recreate the edge ?

Thanks for your advice.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.