export-sketchup
Prep + export the model to SketchUp .skp. Scripts: the shared export-common/strip_prep.py (strip by
type) and exportsu_prep.py next to this file (closed-check + one-block-per-object, SU_APPLY=True to
apply). Export is a run_command step.
Steps
- Model safety — ask each run: SaveAs copy vs current doc (prep is destructive: strip + block-ify).
- Strip — ask which types (spec "옵션으로 물어보기"). Glob
**/export-common/strip_prep.py, dry-run, confirm, then apply:
(Typically keep blocks — they become SU components — and strip 2D curve/hatch/dim clutter. Let the user decide.)STRIP_WHOLE_DOC=True; exec(open(r"<ABS>\strip_prep.py").read()) # dry-run counts STRIP_CURVE=True; STRIP_HATCH=True; STRIP_DIM=True; STRIP_POINT=True; STRIP_BLOCK=False STRIP_WHOLE_DOC=True; STRIP_APPLY=True; exec(open(r"<ABS>\strip_prep.py").read()) # apply chosen - Closed-check + block-ify. Select the objects to export, then:
Report OPEN solids first (fix or accept — they'll be loose faces in SU). Then block-ify.exec(open(r"<ABS>\exportsu_prep.py").read()) # report open solids + counts SU_APPLY=True; exec(open(r"<ABS>\exportsu_prep.py").read()) # each object -> its own block - Export .skp.
run_command('_-Export "C:\\out\\model.skp" _Enter')on the selection.
Gotchas (verified where noted)
- MODAL-DIALOG gotcha (must set up once on this machine). The SKP export options — "Export file as"
version dropdown (set to SketchUp 2013) and "Export planar regions as polygons" — appear as a
MODAL DIALOG that will HANG an automated
-Export. Fix: run one SKP export interactively, set the version to 2013, and tick "Always use these settings. Do not show this dialog again". After that-Exportruns silently. Rhino 7/8 write .skp up to 2021, so 2013 is available. - Block API verified live:
rs.AddBlock([id], base_pt, name, True)+rs.InsertBlock(name, base_pt)→rs.IsBlocktrue, net-zero on cleanup. Rhino blocks map to SketchUp components on export. - Strip classification verified live: block/point/curve/hatch/dim counts matched the document exactly (curve = LINE+CURVE+POLYLINE+CIRCLE, dim = AnnotationBase — checked before Curve).
- SketchUp has no NURBS/solids — everything meshes on export; open surfaces = loose faces, so the closed-check matters. Set a sensible render-mesh density before export to control face count.
- Prep is destructive (strip deletes; block-ify replaces objects with instances) → copy-vs-current prompt in step 1.
Not yet implemented
- Auto-suppressing the SKP dialog (no scriptable token — one-time manual setup above).
- Per-object mesh-density tuning.
Reference
Built 2026-07-01 (task 5 of the 6-task suite). Block + strip APIs verified live on
260629 main ms.3dm. See memory rhino-export-mechanics and the plan.