375487c10c
i18n: - src/i18n/de.json + en.json: 200+ keys covering all main panels - src/i18n/index.js: t(key, vars) reads window.DOSSIER_LANG - panel_base.py: injects window.DOSSIER_LANG from dossier_settings.json - EbenenManager, GeschossManager, AusschnitteApp, LayoutsApp: all context menus and main labels use t() DossierSettings panel: - DossierSettingsApp.jsx: language toggle (DE/EN pill) + launcher status - toolbar.py: OPEN_SETTINGS opens new Rhino-hosted satellite window, SAVE_LANG writes lang to dossier_settings.json + reloads all panels File renames (JSX → English): - ZeichnungsebenenApp → DrawingLevelsApp - GeschossManager/Dialog/Settings → Floor* - AusschnitteApp/Settings → Viewports* - EbenenManager/Settings → Layer* - GestaltungApp → StylesApp, OberleisteApp → ToolbarApp - WerkzeugeApp → ToolsApp, DimensionenApp → DimensionsApp - MassstabApp → ScaleApp, KameraApp → CameraApp - MasseSettingsApp → UnitsSettingsApp - ConfirmDeleteEbene → ConfirmDeleteLayer - AusschnittLayerDialog → ViewportLayerDialog Python module renames: - rhinopanel.py → layers_panel.py - oberleiste.py → toolbar.py - gestaltung.py → styles.py - werkzeuge.py → tools.py - dimensionen.py → dimensions.py - startup.py _MODULE_TO_PY updated, all cross-imports fixed
58 lines
2.3 KiB
Python
58 lines
2.3 KiB
Python
#! python3
|
|
# -*- coding: utf-8 -*-
|
|
# Wrapper fuer dSection: interaktiver Schnitt-Pick (2 Punkte + Blickrichtung).
|
|
# Defaults kommen aus Project-Settings.defaults; nach erfolgreicher
|
|
# Erstellung wird der neue Schnitt als aktive Zeichnungs-Ebene gesetzt.
|
|
import sys, os
|
|
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
|
|
import Rhino
|
|
import scriptcontext as sc
|
|
|
|
doc = Rhino.RhinoDoc.ActiveDoc
|
|
if doc is None:
|
|
print("[SECTION] kein aktives Dokument")
|
|
else:
|
|
try:
|
|
import schnitte
|
|
# Defaults aus Project-Settings; Fallback auf hartkodierte Werte.
|
|
defaults = {
|
|
"depthBack": 8.0, "heightMin": -1.0, "heightMax": 12.0,
|
|
"cutAtLine": True, "namePrefix": "S",
|
|
}
|
|
try:
|
|
import layers_panel as rhinopanel
|
|
ps = rhinopanel.load_project_settings(doc)
|
|
d = (ps or {}).get("defaults", {})
|
|
defaults["depthBack"] = float(d.get("schnittDepthBack", 8.0))
|
|
defaults["heightMin"] = float(d.get("schnittHeightMin", -1.0))
|
|
defaults["heightMax"] = float(d.get("schnittHeightMax", 12.0))
|
|
except Exception as ex:
|
|
print("[SECTION] defaults from project-settings:", ex)
|
|
|
|
sid = schnitte.pick_schnitt_interactive(doc, defaults=defaults)
|
|
if not sid:
|
|
print("[SECTION] abgebrochen")
|
|
else:
|
|
# Broadcast neue Zeichnungs-Ebene an Panels + auto-aktivieren
|
|
try:
|
|
eb = sc.sticky.get("ebenen_bridge")
|
|
if eb is not None:
|
|
eb._send_state()
|
|
except Exception as ex:
|
|
print("[SECTION] broadcast:", ex)
|
|
try:
|
|
import json
|
|
zraw = doc.Strings.GetValue("dossier_zeichnungsebenen") or "[]"
|
|
z_list = json.loads(zraw)
|
|
new_z = next((x for x in z_list
|
|
if isinstance(x, dict) and x.get("id") == sid), None)
|
|
if new_z is not None:
|
|
eb = sc.sticky.get("ebenen_bridge")
|
|
if eb is not None:
|
|
eb._set_active_zeichnungsebene(new_z)
|
|
print("[SECTION] erstellt: {}".format(sid))
|
|
except Exception as ex:
|
|
print("[SECTION] auto-activate:", ex)
|
|
except Exception as ex:
|
|
print("[SECTION] error:", ex)
|