api-issue-tracker
api-issue-tracker copied to clipboard
Layout::Document.save: Version ArgumentError: Could not write to file with Model Ref. (SU > 22)
- SketchUp/LayOut Versions
- Sketchup 21.1.331
- Sketchup 22.0.353
- Sketchup 23.0.418
- OS Platform: macOS Ventura
I am trying to save back LayOut Files into the previous file format.
The Layout::Document.save method returns an argument error if the LO file:
- has a Model Reference
- version greater then 22
Error = ArgumentError: Could not write to file
The code shown at the bottom works in the following conditions
- SU 21
- SU 22
- SU 23 with no Model Reference
Note: I did not see any change in behavior if the file path argument was not changed.
def self.save_as_debug
v = Layout::Document::VERSION_CURRENT - 1
doc = Layout::Document.open("/Users/***/Downloads/Untitled.layout")
doc.save( "/Users/***/Downloads/Untitled #{v}.layout", v )
end
I used to simple LO and SU file to prove this behavior which is shown in the below screenshot.
Thanks for reviewing my issue. Sorry I simplified the method I used to illustrate the issue incorrectly.
I am trying to use save a layout file not export a pdf. The code above is corrected
Logged as: SKEXT-3762
We've not been able to reproduce this. We only saw a serialization error if using the path literally as described in the example: "/Users/***/Downloads/Untitled.layout"
But when provided with a valid path to existing directory it worked fine.
Thom Thom
I just send the exact code, files and a screen capture to [email protected].
It is under "request 2949"
I tried this on Windows 10 and macOS Monterey (m1), still unable to reproduce.