C SDK API Version 10.0 - SketchUp 2022.0 - save SU 2021 format .skp?

Hi All,

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() .

See the modified sample here:

https://drive.google.com/drive/folders/15qndn-waxd3IyJ2UPix_ka-xLLjzPU0l?usp=sharing

@thomthom Is there any way to save SU 2021 format .skp file with C SDK API Version 10.0 - SketchUp 2022.0?

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:

1 Like

@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.

1 Like

@tt_su Thank you very much for the explanation.

Since it’s not a bug, please edit the title topic so as not to confuse people.

@DanRathbun

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.

1 Like

As mentioned, we need to improve the documentation in regard to the new file format behaviour. The new behaviour are intentional changes.

2 Likes