api-issue-tracker icon indicating copy to clipboard operation
api-issue-tracker copied to clipboard

Layout::Document.save: Version ArgumentError: Could not write to file with Model Ref. (SU > 22)

Open 3dmod opened this issue 1 year ago • 5 comments

  1. SketchUp/LayOut Versions
  • Sketchup 21.1.331
  • Sketchup 22.0.353
  • Sketchup 23.0.418
  1. 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.

Screenshot 2023-06-29 at 09 20 50

3dmod avatar Jun 29 '23 13:06 3dmod

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

3dmod avatar Jul 01 '23 02:07 3dmod

Logged as: SKEXT-3762

sketchup[bot] avatar Jul 17 '23 15:07 sketchup[bot]

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.

thomthom avatar Sep 01 '23 09:09 thomthom

Thom Thom

I just send the exact code, files and a screen capture to [email protected].

It is under "request 2949"

3dmod avatar Sep 01 '23 17:09 3dmod

I tried this on Windows 10 and macOS Monterey (m1), still unable to reproduce.

thomthom avatar Sep 27 '23 09:09 thomthom