Sketchup carsh when I use ruby api export layout file.
Crash #224822
sketchup version: win 25.0.660
open 091.skp, run code, then crash
It is right on sketchup 2022
A3.layout
091.skp
# open test skp file '091.skp'
layout_file = 'H:/A3.layout'
doc = Layout::Document.open(layout_file)
find_p = doc.pages.find { |p| p.name == '图框' }
left_top_p_2d = Geom::Point3d.new(60.mm, 75.mm, 0.0)
width, height = 159.mm, 280.mm
x, y = left_top_p_2d.x, left_top_p_2d.y - height
bounds = Geom::Bounds2d.new(x, y, width, height)
model = Layout::SketchUpModel.new(Sketchup.active_model.path, bounds)
model.current_scene = 1
model.render_mode = Layout::SketchUpModel::RASTER_RENDER
model.scale = 1.0 / 75
model.perspective = false # 平行投影
model.line_weight = 0.5
doc.add_entity model, doc.layers.first, find_p
doc.save('H:/A3_save.layout')
What version of SketchUp is crashing ?
Okay, can you provide a minimal snippet to reproduce the crash
and open an issue in the GitHub API Issue tracker, please?
@Colin , can you determine the root cause for the crash number given?
colin
August 6, 2025, 1:38pm
5
It seems to be environment related. There is an issue that can happen if a linked model has unused environments in it. Purging those solves the other problem, though that one was Mac specific. Still could be worth trying.
1 Like
Is it like the crash reported here:
The problem remains when creating a Layout API document with the ‘photoreal materials’ style. It crashes as soon as it reaches the creation of
render_mode = Layout::SketchUpModel::RASTER_RENDER
SU 2025.0.660
colin
August 6, 2025, 1:48pm
7
There is that one too, and that seems to be fixed in internal builds. The next version we release should have the fix in it. For now it may be that you have to remove any environment.
2 Likes
Yes I will organize the minimal test code.
I used Windbg to locate the crash code and attempted to extract the minimum test code
1 Like
system
Closed
December 9, 2025, 1:10am
10
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.