Sketchup crash when export layout file with Ruby API

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 ?

sketchup win 25.0.660

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?

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:

:red_question_mark:

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

fixed - SU2026.0
Sketchup crash when export layout with ruby api. · Issue #1062 · SketchUp/api-issue-tracker

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.