It seems to me that the SUModelSaveToFileWithVersion() function saves SketchUp 2022 format .skp file when called with SUModelVersion_SU2021 . Have anybody else experienced it?
To demonstrate I have modified the Texture Mapping example shipped with the SDK by changing line 84 to use SUModelSaveToFileWithVersion() .
No, as if SU2021 SketchUp’s fileformat changed. SUModelVersion_SU2021 is the same as SUModelVersion_Current in SU2021 and SU2022+ SDK.
We need to document this better.
But, a .skp file saves with SU2022 SDK can be opened by SU2021. You would only need to down-save if you need to open the file on SketchUp versions older than SU2021.
SU2021 is able to open .skp files generated by newer SketchUp version. Though when opening via the UI there will be a message informing that the file was created with a newer version.
However, you need to use the new file functions/methods:
@thomthom Thank you very much for your fast and comprehensive answer. Now I think understand how to circumvent it but still find a little bit odd that SUModelSaveToFileWithVersion() is unable to save in one of the given versions.
Thank you again for the answer it is a great help.
It’s due to the fileformat changes, it’s meant to be “versionless”. Though the new behaviour wasn’t documented well in the docs, we need to update them with better description.
I’ve corrected the title as requested but I still think it is not the behavior of SUModelSaveToFileWithVersion() what is documented or what is consistent with the behavior in previous versions. So if it was not a bug in the code than this is bug at the documentation.