Skip to content

SolidCraft: an open-source parametric 3D CAD application built in pure Rust. Desktop, web, and automation through MCP.

Offer to stand up SolidWorks files instead of turning them silently; add Turn Up Axis to the component menu (#5655)

bherbruckc3ed8b1c07e7
diff --git a/assets/locales/en.json b/assets/locales/en.json
index 49037d934b..4d47a2a057 100644
--- a/assets/locales/en.json
+++ b/assets/locales/en.json
@@ -176,6 +176,7 @@
"Export JSON…": "Export JSON…",
"Export design library...": "Export design library...",
"Export hidden edges as dashed lines": "Export hidden edges as dashed lines",
+ "Exported by SolidWorks, which usually saves Y up": "Exported by SolidWorks, which usually saves Y up",
"Expression": "Expression",
"Extend to meet": "Extend to meet",
"Extents": "Extents",
diff --git a/assets/locales/ja.json b/assets/locales/ja.json
index 773d5427c9..2e390d2cfb 100644
--- a/assets/locales/ja.json
+++ b/assets/locales/ja.json
@@ -176,6 +176,7 @@
"Export JSON…": "JSONを書き出し…",
"Export design library...": "デザインライブラリを書き出す...",
"Export hidden edges as dashed lines": "点線で出力",
+ "Exported by SolidWorks, which usually saves Y up": "SolidWorks で書き出されたファイルです。通常は Y 軸が上になります",
"Expression": "式",
"Extend to meet": "交わるまで延長",
"Extents": "範囲",
diff --git a/assets/locales/zh.json b/assets/locales/zh.json
index 5f29371b69..6717402b3d 100644
--- a/assets/locales/zh.json
+++ b/assets/locales/zh.json
@@ -176,6 +176,7 @@
"Export JSON…": "导出 JSON…",
"Export design library...": "导出设计库...",
"Export hidden edges as dashed lines": "以虚线导出隐藏线",
+ "Exported by SolidWorks, which usually saves Y up": "由 SolidWorks 导出,通常以 Y 轴向上保存",
"Expression": "表达式",
"Extend to meet": "延伸至相交",
"Extents": "范围",
diff --git a/crates/ui-egui/src/context_menu.rs b/crates/ui-egui/src/context_menu.rs
index fc2d75ac99..77c75f324a 100644
--- a/crates/ui-egui/src/context_menu.rs
+++ b/crates/ui-egui/src/context_menu.rs
@@ -724,6 +724,13 @@ fn occurrence_items(app: &SolveApp, path: &[u64]) -> Vec<Item> {
item.enabled = !placement.grounded && app.session.held_by_rigid_group(placement.occurrence).is_none();
}
"ui.properties" => item.params = Some(json!({"occurrence": placement.occurrence, "path": path})),
+ "ui.turnUpAxis" => {
+ for child in &mut item.children {
+ if let Some(params) = child.params.as_mut() {
+ params["occurrence"] = json!(placement.occurrence);
+ }
+ }
+ }
"occurrence.copy" => item.params = Some(json!({"occurrence": placement.occurrence, "translate": [10,10,0]})),
"component.create" => item.params = Some(json!({"parent": placement.component, "parent_path": path})),
"component.paste_new" => {
@@ -750,6 +757,19 @@ fn occurrence_items(app: &SolveApp, path: &[u64]) -> Vec<Item> {
entries
}
+/// "Turn Up Axis": a quarter turn about X of a component's occurrence for a file saved with the
+/// other axis up, one `occurrence.move` (one undo step).
+fn turn_up_axis(occurrence: u64, enabled: bool) -> Item {
+ let mut item = act("ui.turnUpAxis", "Turn Up Axis", "move").on(enabled);
+ item.children = [("Y up \u{2192} Z up", "90 deg"), ("Z up \u{2192} Y up", "-90 deg")]
+ .into_iter()
+ .map(|(label, angle)| {
+ act("occurrence.move", label, "move").with(json!({"occurrence": occurrence, "axis": [1, 0, 0], "angle": angle})).on(enabled)
+ })
+ .collect();
+ item
+}
+
fn component_items(app: &SolveApp, id: u64) -> Vec<Item> {
let doc = &app.session.doc;
let occ = doc.occurrence_of(id);
@@ -772,6 +792,7 @@ fn component_items(app: &SolveApp, id: u64) -> Vec<Item> {
.with(json!({ "occurrence": oid }))
.on(!grounded && occ.is_some() && app.session.held_by_rigid_group(oid).is_none()),
);
+ v.push(turn_up_axis(oid, !grounded && occ.is_some() && app.session.held_by_rigid_group(oid).is_none()));
v.push(cmd(app, "component.capture_position", "Capture Position").on(!app.session.pending_moves.is_empty()));
v.push(cmd(app, "component.revert_position", "Revert Position").on(!app.session.pending_moves.is_empty()));
// An imported assembly moves as one until its rigid group is released.
diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs
index c425b71c81..80bc7f88bd 100644
--- a/crates/ui-egui/src/lib.rs
+++ b/crates/ui-egui/src/lib.rs
@@ -452,6 +452,8 @@ pub struct SolveApp {
pub stand_up: Option<Vec<String>>,
/// The placement of the component that file came in as: the offer turns it.
pub stand_up_occurrence: Option<u64>,
+ /// The file's header names an exporter that saves Y up (SolidWorks): the offer says so.
+ pub stand_up_reason: bool,
/// The anti-aliasing sample counts the graphics device supports (empty without a GPU).
pub msaa_supported: Vec<u32>,
/// Settings put back at start because they kept SolidCraft from starting, one line each,
@@ -585,6 +587,7 @@ impl SolveApp {
recoverable: Vec::new(),
stand_up: None,
stand_up_occurrence: None,
+ stand_up_reason: false,
msaa_supported: Vec::new(),
settings_reset: Vec::new(),
big_operation: false,
diff --git a/crates/ui-egui/src/prefs.rs b/crates/ui-egui/src/prefs.rs
index f89d8395e2..7fdcd39f21 100644
--- a/crates/ui-egui/src/prefs.rs
+++ b/crates/ui-egui/src/prefs.rs
@@ -529,9 +529,6 @@ preference_settings! {
look_at_speed: f32 = 1.0, PAGE_NAVIGATION, accept(0.25..=4.0) => enabled_slider(look_at_anim, "Animation speed", 0.5..=3.0, 0.25, |v| format!("{v:.2}×"));
/// Default modelling orientation: `z` (Z up) or `y` (Y up) (#3).
up_axis: String = "z".into(), PAGE_DESIGN;
- /// A STEP or IGES file whose header names a Y-up exporter (SolidWorks) is stood up as it
- /// opens, with an Undo in the toast (`stand_up`).
- auto_stand_up: bool = true, PAGE_DESIGN => check("Stand up Y-up files automatically", "A STEP or IGES file from a program that saves Y up opens standing, with Undo in the message");
/// After a STEP or IGES file opens, offer to stand a Y-up part up (`stand_up`).
offer_stand_up: bool = true, PAGE_DESIGN => check("Offer to stand up Y-up files", "After a STEP or IGES file opens with Z up, offer a quarter turn about X");
/// What a middle-button double-click in the view does: `home`, `fit` or `off`.
diff --git a/crates/ui-egui/src/prefs/design.rs b/crates/ui-egui/src/prefs/design.rs
index 8d0cf8dc73..40acab12c2 100644
--- a/crates/ui-egui/src/prefs/design.rs
+++ b/crates/ui-egui/src/prefs/design.rs
@@ -49,7 +49,6 @@ pub(super) fn show(app: &mut SolveApp, ui: &mut egui::Ui) {
crate::i18n::tr_label("Which axis points up in the views (axis view, Home, Look At). Designs are unchanged."),
ui_kit::Text::Hint("orientation"),
);
- setting::auto_stand_up(app, ui);
setting::offer_stand_up(app, ui);
ui_kit::text(ui, app.tr("prefs.stand_up_note"), ui_kit::Text::Hint("stand_up"));
});
diff --git a/crates/ui-egui/src/stand_up.rs b/crates/ui-egui/src/stand_up.rs
index db62a7c5f9..b64dee4dae 100644
--- a/crates/ui-egui/src/stand_up.rs
+++ b/crates/ui-egui/src/stand_up.rs
@@ -1,10 +1,11 @@
//! Standing up a Y-up file (#3). Many CAD programs save parts with Y up, so a STEP or IGES file
//! from them opens lying on its back in a Z-up design. After such a file opens, SolidCraft
//! offers to stand it up: a quarter turn about X (Y → Z) of the component the file came in as
-//! (#1386), so an assembly's parts and instances turn together, in one step that can be undone. Preferences › Design › "Offer to stand up Y-up
-//! files" turns the offer off; with Y up as the default orientation it isn't needed. When the
-//! file's header names an exporter known to save Y up (SolidWorks), Preferences › Design ›
-//! "Stand up Y-up files automatically" stands it up without asking, with Undo in the message.
+//! (#1386), so an assembly's parts and instances turn together, in one step that can be undone.
+//! Preferences › Design › "Offer to stand up Y-up files" turns the offer off; with Y up as the
+//! default orientation it isn't needed. The file is never turned without asking: a header that
+//! names an exporter known to save Y up (SolidWorks) only adds a reason line to the offer, since
+//! such a file may have been saved Z up. The context menu's "Turn Up Axis" fixes it any time.
use serde_json::json;
@@ -29,29 +30,18 @@ pub fn offer(app: &mut SolveApp, path: &str, before: &[String], result: Option<&
return;
}
let occurrence = result.and_then(|r| r.get("occurrence")).and_then(serde_json::Value::as_u64);
- // A header that names a Y-up exporter: stand it up now, one undoable step, with Undo in the toast.
- if text("exporter_up") == Some("y") && app.preferences.auto_stand_up {
- let exporter = text("exporter").unwrap_or("a Y-up program").to_string();
- app.stand_up = Some(bodies);
- app.stand_up_occurrence = occurrence;
- match stand_up(app) {
- Ok(()) => {
- app.set_status(format!("Stood up (exported Y-up by {exporter}) \u{2014} Undo"), false);
- app.status_undo = true;
- }
- Err(e) => app.set_status(e, true),
- }
- return;
- }
if !app.preferences.offer_stand_up {
return;
}
+ // A header naming a Y-up exporter adds the reason; the file is never turned without asking.
+ app.stand_up_reason = text("exporter_up") == Some("y");
app.stand_up = Some(bodies);
app.stand_up_occurrence = occurrence;
}
/// Turn the offered bodies a quarter turn about X (Y up becomes Z up).
pub fn stand_up(app: &mut SolveApp) -> Result<(), String> {
+ app.stand_up_reason = false;
let Some(bodies) = app.stand_up.take() else { return Err("no file is waiting to be stood up".into()) };
match app.stand_up_occurrence.take() {
// The import's component turns about its parent's origin, contents and all.
@@ -66,6 +56,7 @@ pub fn stand_up(app: &mut SolveApp) -> Result<(), String> {
/// Dismiss the offer and keep the file as it opened ("Leave it"); the preference stays on.
pub fn leave(app: &mut SolveApp) {
app.stand_up = None;
+ app.stand_up_reason = false;
app.stand_up_occurrence = None;
}
@@ -83,6 +74,9 @@ pub fn show(app: &mut SolveApp, ctx: &egui::Context) {
crate::i18n::tr_label("Files from many CAD programs have Y up, so they open lying on their back here (Z up)."),
ui_kit::Text::Report("why", false),
);
+ if app.stand_up_reason {
+ ui_kit::text(ui, crate::i18n::tr_label("Exported by SolidWorks, which usually saves Y up"), ui_kit::Text::Report("reason", false));
+ }
ui_kit::text(
ui,
crate::i18n::tr_label("Stand it up: a quarter turn about X, as one Move feature you can undo."),
diff --git a/crates/ui-egui/tests/stand_up_offer.rs b/crates/ui-egui/tests/stand_up_offer.rs
index 5c5464c6b9..e767d426eb 100644
--- a/crates/ui-egui/tests/stand_up_offer.rs
+++ b/crates/ui-egui/tests/stand_up_offer.rs
@@ -81,18 +81,25 @@ fn prefs_stand_up_false_leaves_the_offer() {
}
#[test]
-fn a_solidworks_header_stands_the_file_up_with_undo() {
+fn a_solidworks_header_shows_the_offer_and_does_not_turn_the_file() {
+ let h = opened_from("'SolidWorks 2021','SolidWorks 2021'", |_| {});
+ assert_eq!(h.app.stand_up.as_ref().map(Vec::len), Some(1), "offered");
+ assert!(h.app.stand_up_reason, "with the reason line");
+ assert!(!h.app.status_undo, "nothing was turned");
+ assert!((height(&h) - 5.0).abs() < 1e-6, "not turned: {}", height(&h));
+ // An unknown exporter gets the offer without the reason.
+ assert!(!opened().app.stand_up_reason);
+}
+
+#[test]
+fn stand_it_up_from_a_solidworks_offer_turns_once_and_undo_restores() {
let mut h = opened_from("'SolidWorks 2021','SolidWorks 2021'", |_| {});
- assert!(h.app.stand_up.is_none(), "no offer: it stood up on its own");
- assert!((height(&h) - 40.0).abs() < 1e-6, "stood up: {}", height(&h));
- let status = h.app.status.clone().map(|s| s.0);
- assert_eq!(status.as_deref(), Some("Stood up (exported Y-up by SolidWorks) \u{2014} Undo"));
- assert!(h.app.status_undo);
- // Clicking the message is the Undo: one step puts the file back as it was written.
- h.run(&json!([{"click": {"handle": "status:chip"}}])).unwrap();
+ h.run(&json!([{"click": {"handle": "stand_up:stand"}}])).unwrap();
h.frames(3);
+ assert!((height(&h) - 40.0).abs() < 1e-6, "stood up: {}", height(&h));
+ assert!(!h.app.stand_up_reason);
+ h.app.run("edit.undo", json!({})).unwrap();
assert!((height(&h) - 5.0).abs() < 1e-6, "undone: {}", height(&h));
- assert!(h.app.stand_up.is_none());
}
#[test]
@@ -104,26 +111,39 @@ fn a_solidcraft_header_is_left_alone() {
}
#[test]
-fn automatic_stand_up_off_offers_a_solidworks_file_instead() {
- let h = opened_from("'SolidWorks 2021','SolidWorks 2021'", |h| h.app.preferences.auto_stand_up = false);
- assert_eq!(h.app.stand_up.as_ref().map(Vec::len), Some(1), "offered, not turned");
- assert!((height(&h) - 5.0).abs() < 1e-6);
-}
-
-#[test]
-fn the_offer_preference_off_does_not_stop_a_known_y_up_file() {
- // An unknown exporter is not offered, but a SolidWorks file still stands up.
+fn the_offer_preference_off_stops_every_offer() {
let off = |h: &mut Harness| h.app.preferences.offer_stand_up = false;
assert!(opened_from("'Example CAD','Example CAD'", off).app.stand_up.is_none());
let h = opened_from("'SolidWorks 2021','SolidWorks 2021'", off);
- assert!((height(&h) - 40.0).abs() < 1e-6, "stood up: {}", height(&h));
+ assert!(h.app.stand_up.is_none());
+ assert!((height(&h) - 5.0).abs() < 1e-6, "not turned: {}", height(&h));
+}
+
+#[test]
+fn turn_up_axis_in_the_component_menu_turns_and_undo_restores() {
+ // Leave the offer, then fix the orientation from the right-click menu.
+ let mut h = opened();
+ h.run(&json!([{"click": {"handle": "stand_up:leave"}}])).unwrap();
+ h.frames(3);
+ let occurrence = h.app.session.doc.occurrences.iter().map(|o| o.id).max().expect("the import's occurrence");
+ let items = solidcraft_ui_egui::context_menu::items(&h.app, &solidcraft_ui_egui::context_menu::Target::Occurrence { path: vec![occurrence] });
+ let turn = items.iter().find(|i| i.id == "ui.turnUpAxis").expect("Turn Up Axis is in the menu");
+ let labels: Vec<_> = turn.children.iter().map(|c| c.label.as_str()).collect();
+ assert_eq!(labels, ["Y up \u{2192} Z up", "Z up \u{2192} Y up"]);
+ let at = egui::pos2(10.0, 10.0);
+ solidcraft_ui_egui::context_menu::run_item(&mut h.app, &turn.children[0], at);
+ assert!((height(&h) - 40.0).abs() < 1e-6, "Y up to Z up: {}", height(&h));
+ h.app.run("edit.undo", json!({})).unwrap();
+ assert!((height(&h) - 5.0).abs() < 1e-6, "undone: {}", height(&h));
+ solidcraft_ui_egui::context_menu::run_item(&mut h.app, &turn.children[1], at);
+ assert!((height(&h) - 40.0).abs() < 1e-6, "Z up to Y up: {}", height(&h));
}
#[test]
-fn old_preferences_files_load_with_automatic_stand_up_on() {
- let old: solidcraft_ui_egui::prefs::Prefs = serde_json::from_str(r#"{"offer_stand_up": false, "up_axis": "z"}"#).unwrap();
+fn old_preferences_files_still_load() {
+ // A file saved while "Stand up automatically" existed: the retired key is ignored.
+ let old: solidcraft_ui_egui::prefs::Prefs = serde_json::from_str(r#"{"offer_stand_up": false, "auto_stand_up": true, "up_axis": "z"}"#).unwrap();
assert!(!old.offer_stand_up, "the saved choice is kept");
- assert!(old.auto_stand_up, "the new setting starts on");
let empty: solidcraft_ui_egui::prefs::Prefs = serde_json::from_str("{}").unwrap();
- assert!(empty.auto_stand_up && empty.offer_stand_up);
+ assert!(empty.offer_stand_up);
}
diff --git a/docs/control-protocol.md b/docs/control-protocol.md
index d36ee69ca8..272b60f981 100644
--- a/docs/control-protocol.md
+++ b/docs/control-protocol.md
@@ -205,7 +205,7 @@ labels; `prefs:measure_axis_distances` identifies the checkbox.
| `ui.home` | `open?`: bool; `sample?`: index | the start page: show or hide it, open a built-in sample (once built); returns `open` and the recent designs |
| `ui.shortcut` | `command`, `key?`, `replace?` | a command's key, or rebinds it (`""` clears; a key another command uses is refused unless `replace`) |
| `ui.help` | `item?`: `about`, `shortcuts` (read only), `report` (opens a report draft for review), `crashes` (the Crash Reports window) | the version, commit, build date and diagnostic text |
-| `ui.prefs` | any of `default_units`, `nav` (`fusion`, `solidworks`, `inventor`, `alias`, `blender`, `tinkercad`, `openscad`, `touchpad`), `zoom_reverse`, `pan_reverse_x` (default false: horizontal scrolling pans the other way), `zoom_to_cursor`, `smooth_wheel_zoom` (default true), `trackpad_pan` (default true: two-finger scroll pans, except Touchpad always zooms; pinch zooms), `orbit_around` (`view_centre` (default: what Pan moves and Fit frames), `origin` (the world origin stays still on screen), `cursor` (the model point under the pointer when the drag began); the older `orbit_cursor` boolean still sets `cursor` when true), `look_at_anim`, `look_at_speed`, `middle_double_click` (`home` (default), `fit`, `off`), `msaa`, `show_frame_rate` (default false: frames per second in the view's bottom-right corner, counting the frames the view draws anyway; it reads 0 FPS once the view is idle), `length_decimals`, `angle_decimals`, `theme` (`dark`, `light`, `system` or a theme file's id: a built-in one such as `gruvbox-dark`, or an imported one; the reply's `theme_ids` lists them), `theme_import` (a `solidcraft-theme/1` file's JSON or text: adds the theme and turns it on; the reply's `theme_imported` is its id), `theme_remove` (an imported theme's id), `theme_export: true` (the reply's `theme_file` is the theme on now as a complete file; see [colour themes](book/src/guide/ui-tour.md#colour-themes)), `language` (`en`, `ja`, `de`, `fr`, `ko`, `ms`, `ru`, `uk`, `zh`; see [localization](localization.md)), `ui_scale`, `ui_font` (an installed font family or a font file for the interface; empty for the built-in font), `up_axis` (`z`, `y`), `auto_stand_up` (default true: a STEP or IGES file whose header names a Y-up exporter, SolidWorks, is stood up as it opens), `offer_stand_up`, `color_vision` (`off` (default), `protan`, `deutan`, `tritan`: colour vision modes, #778), `check_updates` (default true; [updates](book/src/guide/updates.md)); `open` (a page: General, Interface, Design, Navigation, Keyboard Shortcuts, Sketch, Graphics, AI, Plugins; Shortcuts, Assistant and Sketch & selection are aliases, and the former Selection page opens Sketch) opens the Preferences dialog there; `button`: `ok`, `cancel`, `apply`, `defaults`; `stand_up: true` stands up a just-opened Y-up file, `stand_up: false` leaves it as it is ("Leave it": the offer closes and `offer_stand_up` stays on); the offer's buttons are the handles `stand_up:stand`, `stand_up:leave` and `stand_up:never` | sets preferences (kept between runs), returns them all plus `dialog` (the open page or null), `dark` and `stand_up_offer` |
+| `ui.prefs` | any of `default_units`, `nav` (`fusion`, `solidworks`, `inventor`, `alias`, `blender`, `tinkercad`, `openscad`, `touchpad`), `zoom_reverse`, `pan_reverse_x` (default false: horizontal scrolling pans the other way), `zoom_to_cursor`, `smooth_wheel_zoom` (default true), `trackpad_pan` (default true: two-finger scroll pans, except Touchpad always zooms; pinch zooms), `orbit_around` (`view_centre` (default: what Pan moves and Fit frames), `origin` (the world origin stays still on screen), `cursor` (the model point under the pointer when the drag began); the older `orbit_cursor` boolean still sets `cursor` when true), `look_at_anim`, `look_at_speed`, `middle_double_click` (`home` (default), `fit`, `off`), `msaa`, `show_frame_rate` (default false: frames per second in the view's bottom-right corner, counting the frames the view draws anyway; it reads 0 FPS once the view is idle), `length_decimals`, `angle_decimals`, `theme` (`dark`, `light`, `system` or a theme file's id: a built-in one such as `gruvbox-dark`, or an imported one; the reply's `theme_ids` lists them), `theme_import` (a `solidcraft-theme/1` file's JSON or text: adds the theme and turns it on; the reply's `theme_imported` is its id), `theme_remove` (an imported theme's id), `theme_export: true` (the reply's `theme_file` is the theme on now as a complete file; see [colour themes](book/src/guide/ui-tour.md#colour-themes)), `language` (`en`, `ja`, `de`, `fr`, `ko`, `ms`, `ru`, `uk`, `zh`; see [localization](localization.md)), `ui_scale`, `ui_font` (an installed font family or a font file for the interface; empty for the built-in font), `up_axis` (`z`, `y`), `offer_stand_up`, `color_vision` (`off` (default), `protan`, `deutan`, `tritan`: colour vision modes, #778), `check_updates` (default true; [updates](book/src/guide/updates.md)); `open` (a page: General, Interface, Design, Navigation, Keyboard Shortcuts, Sketch, Graphics, AI, Plugins; Shortcuts, Assistant and Sketch & selection are aliases, and the former Selection page opens Sketch) opens the Preferences dialog there; `button`: `ok`, `cancel`, `apply`, `defaults`; `stand_up: true` stands up a just-opened Y-up file, `stand_up: false` leaves it as it is ("Leave it": the offer closes and `offer_stand_up` stays on); the offer's buttons are the handles `stand_up:stand`, `stand_up:leave` and `stand_up:never` | sets preferences (kept between runs), returns them all plus `dialog` (the open page or null), `dark` and `stand_up_offer` |
| `ui.capture` | `action?`: `capture`, `revert`, `cancel` | answers the Capture Position question (asked when a command starts or the design is saved while components were moved without capturing); without `action`, what waits |
| `ui.window` | `action`: minimize, maximize, restore, toggle, close | what the title bar's caption buttons do (on Windows and Linux the application bar is the title bar); close asks about unsaved designs first |
| `ui.agent_cursor` | `show` (bool), `speed`: a number from 1 to 5 (times the normal speed) or `"instant"` (no animation: the command runs at once and the pointer jumps to where it acted), `follow_camera` (bool); all optional | the settings. While the cursor is shown, `engine.execute` first glides to the command's toolbar button and to each pick, then runs and replies; later requests wait their turn. It also follows the pointer input sent with `ui.move`, `ui.click`, `ui.drag` and `ui.scroll`, as each event reaches the app, and a press leaves a ripple. `"animate": false` on a call skips it |
diff --git a/docs/step-import.md b/docs/step-import.md
index 8e380e4a25..95a4364004 100644
--- a/docs/step-import.md
+++ b/docs/step-import.md
@@ -45,7 +45,7 @@ the supporting ellipse in the middle.
Files from different systems differ in which way is up and in what they call their solids. `doc.open`, `file.insert_step` and the MCP `open` tool take two options for STEP and IGES files; without them a file comes in as written.
-- **`up`**: `"z"` (the default) keeps the file's axes. Many systems write Y up, so such a part lies on its back in SolidCraft's Z-up space. `"up": "y"` turns the import's component a quarter turn about X (+90°: Y becomes Z), as the window's "Stand it up" offer does, so an assembly's parts and instances turn together. The import and the turn are one undo step, the reply names the turned occurrence as `stand_up`, and only the file's component turns, not what is already in the design. The window offers to stand a part up after a STEP file opens unless the call said which way is up (`up: "z"` as well as `"y"`) or the file came from SolidCraft, which already writes Z up. A STEP reply's `system` is the originating system the file's header names (`SolidCraft` for SolidCraft's own exports). A header that names SolidWorks (in FILE_NAME's originating system or preprocessor version, or in FILE_DESCRIPTION; for IGES, the start of the global section's native system ID, which becomes the originating system) says the file has Y up: the reply carries `exporter` (`SolidWorks`) and `exporter_up` (`y`), and with Preferences › Design › "Stand up Y-up files automatically" on (the default) the window stands the part up as it opens, as one undo step, with Undo in the message. SolidCraft's own files say `z` and are left alone; any other exporter is unknown, so the offer stays.
+- **`up`**: `"z"` (the default) keeps the file's axes. Many systems write Y up, so such a part lies on its back in SolidCraft's Z-up space. `"up": "y"` turns the import's component a quarter turn about X (+90°: Y becomes Z), as the window's "Stand it up" offer does, so an assembly's parts and instances turn together. The import and the turn are one undo step, the reply names the turned occurrence as `stand_up`, and only the file's component turns, not what is already in the design. The window offers to stand a part up after a STEP file opens unless the call said which way is up (`up: "z"` as well as `"y"`) or the file came from SolidCraft, which already writes Z up. A STEP reply's `system` is the originating system the file's header names (`SolidCraft` for SolidCraft's own exports). A header that names SolidWorks (in FILE_NAME's originating system or preprocessor version, or in FILE_DESCRIPTION; for IGES, the start of the global section's native system ID, which becomes the originating system) says the file has Y up: the reply carries `exporter` (`SolidWorks`) and `exporter_up` (`y`), and the window's offer then says so ("Exported by SolidWorks, which usually saves Y up"). A file is never turned without asking, because the exporter may have saved it Z up; a component's right-click menu has Turn Up Axis (Y up → Z up, Z up → Y up: a quarter turn about X, one undo step) for fixing it any time. SolidCraft's own files say `z` and are left alone; any other exporter is unknown, so the offer stays.
- **`names`**: `"auto"` (the default) keeps meaningful solid names and replaces placeholders such as `Body1` or `Body 2 (3)` with the nearest named product, then the occurrence name if no product is named. `"solid"` keeps the solid's name; `"product"` chooses the part's name; `"instance"` chooses the assembly occurrence (`Post-2`), falling back to the product. If the chosen name is missing, the solid's name remains. Repeated names are numbered (`Post`, `Post (2)`). Names are stored with the Import feature and survive reopening the design. Files without names or assembly metadata retain generated body names and a flat structure.
- **Vertices off their curves**: some systems write an edge's vertex a little beside the end of its curve, often further off than the accuracy the file declares (`UNCERTAINTY_MEASURE_WITH_UNIT`). A vertex up to the file's own tolerance off, or up to 1/1000 of the model's size (never more than 1 mm), is read as that end of the edge: the curve's end is moved onto the vertex. A vertex further off leaves its face out, with a warning that says how far off it is.