Rename all log tags to match English module names

[EBENEN] → [LAYERS], [EBENEN-BE] → [LAYERS-BE]
[ZEICHNUNGSEBENEN] → [DRAWING-LEVELS]
[GESTALTUNG] → [STYLES]
[OBERLEISTE] → [TOOLBAR]
[WERKZEUGE] → [TOOLS]
[DIMENSIONEN] → [DIMENSIONS]
[AUSSCHNITTE] → [VIEWPORTS]
[MASSSTAB] → [SCALE]
[SCHNITT] → [SECTION], [SCHNITT_GRIPS] → [SECTION-GRIPS]
[WAND_GRIPS] → [WALL-GRIPS], [TREPPE_GRIPS] → [STAIR-GRIPS]
[CURVE_DOTS] → [CURVE-DOTS]
[panel_base] → [CORE]
[ALIAS-LOADER] → [ALIASES]
[BEGIN-CMD] → [CMD-HOOK]
This commit is contained in:
2026-06-06 12:48:27 +02:00
parent 84ff943f92
commit b9a2124026
16 changed files with 471 additions and 471 deletions
+134 -134
View File
@@ -33,7 +33,7 @@ def _run(cmd):
try:
Rhino.RhinoApp.RunScript(cmd, False)
except Exception as ex:
print("[OBERLEISTE] RunScript-Fehler ({}): {}".format(cmd, ex))
print("[TOOLBAR] RunScript-Fehler ({}): {}".format(cmd, ex))
# --- Window-Layout-Management + App-Settings -------------------------------
@@ -74,7 +74,7 @@ def _settings_load():
data["windowLayout"] = data.get("defaultLayout") or ""
return data
except Exception as ex:
print("[OBERLEISTE] settings_load ({}):".format(p), ex)
print("[TOOLBAR] settings_load ({}):".format(p), ex)
return {}
@@ -89,7 +89,7 @@ def _settings_save(data):
.encode("utf-8"))
return True
except Exception as ex:
print("[OBERLEISTE] settings_save:", ex)
print("[TOOLBAR] settings_save:", ex)
return False
@@ -133,7 +133,7 @@ def _apply_viewport_colors(cfg):
try:
appset = Rhino.ApplicationSettings.AppearanceSettings
except Exception as ex:
print("[OBERLEISTE] AppearanceSettings not available:", ex)
print("[TOOLBAR] AppearanceSettings not available:", ex)
return False
applied = []
for key, attr in _VIEWPORT_COLOR_ATTRS:
@@ -144,13 +144,13 @@ def _apply_viewport_colors(cfg):
setattr(appset, attr, col)
applied.append(key)
except Exception as ex:
print("[OBERLEISTE] view-color {} -> {}: {}".format(key, attr, ex))
print("[TOOLBAR] view-color {} -> {}: {}".format(key, attr, ex))
if applied:
# Redraw aller Viewports damit die neuen Farben sofort sichtbar werden.
try:
for v in Rhino.RhinoDoc.ActiveDoc.Views: v.Redraw()
except Exception: pass
print("[OBERLEISTE] Viewport-Colors applied:", applied)
print("[TOOLBAR] Viewport-Colors applied:", applied)
return bool(applied)
@@ -162,20 +162,20 @@ def _import_display_modes(paths):
try:
DMD = Rhino.Display.DisplayModeDescription
except Exception as ex:
print("[OBERLEISTE] DisplayModeDescription not available:", ex)
print("[TOOLBAR] DisplayModeDescription not available:", ex)
return 0
for p in paths:
try:
if not os.path.isfile(p):
print("[OBERLEISTE] Display-Mode-Pfad fehlt:", p); continue
print("[TOOLBAR] Display-Mode-Pfad fehlt:", p); continue
res = DMD.ImportFromFile(p)
if res:
count += 1
print("[OBERLEISTE] Display-Mode importiert:", p)
print("[TOOLBAR] Display-Mode importiert:", p)
else:
print("[OBERLEISTE] Display-Mode-Import lieferte False:", p)
print("[TOOLBAR] Display-Mode-Import lieferte False:", p)
except Exception as ex:
print("[OBERLEISTE] Display-Mode-Import-Fehler ({}): {}".format(p, ex))
print("[TOOLBAR] Display-Mode-Import-Fehler ({}): {}".format(p, ex))
if count:
# Cache invalidieren damit das Display-Dropdown die Neuen aufnimmt.
try:
@@ -222,7 +222,7 @@ def _apply_dossier_plan_attrs(dmd):
and ("idden" in n or "ngent" in n or "ilho" in n
or "ire" in n or "soc" in n or "dge" in n
or "ech" in n or "hade" in n or "ection" in n)])
print("[OBERLEISTE] Plan-Mode Attrs-Inventar:", ", ".join(relevant))
print("[TOOLBAR] Plan-Mode Attrs-Inventar:", ", ".join(relevant))
# Sub-Objekt-Settings sind in Rhino 8 oft eigene Klassen
for sub in ("CurveSettings", "ObjectSettings", "ShadingSettings",
"MeshSpecificAttributes"):
@@ -234,10 +234,10 @@ def _apply_dossier_plan_attrs(dmd):
or "soc" in n or "ire" in n
or "dge" in n)])
if sub_props:
print("[OBERLEISTE] Plan-Mode {}:".format(sub),
print("[TOOLBAR] Plan-Mode {}:".format(sub),
", ".join(sub_props))
except Exception as ex:
print("[OBERLEISTE] Plan-Mode inspect:", ex)
print("[TOOLBAR] Plan-Mode inspect:", ex)
_apply_dossier_plan_attrs._props_logged = True
# Surfaces gefuellt + weiss + kein Shading
try: attrs.ShadingEnabled = False
@@ -282,7 +282,7 @@ def _apply_dossier_plan_attrs(dmd):
attrs.MeshSpecificAttributes.ShowMeshWires = False
attrs.MeshSpecificAttributes.ShowMeshVertices = False
except Exception as ex:
print("[OBERLEISTE] Plan-Mode MeshSpecificAttributes:", ex)
print("[TOOLBAR] Plan-Mode MeshSpecificAttributes:", ex)
# Section-Styles MUESSEN aktiv sein damit Custom-Section-Styles
# (per-Layer oder per-Object) tatsaechlich gerendert werden. Default
# ist False — d.h. Section-Hatches werden zugewiesen aber nicht angezeigt.
@@ -294,10 +294,10 @@ def _apply_dossier_plan_attrs(dmd):
except Exception: pass
try: attrs.UseSectionStyles = True
except Exception as ex:
print("[OBERLEISTE] Plan-Mode UseSectionStyles set:", ex)
print("[TOOLBAR] Plan-Mode UseSectionStyles set:", ex)
try: post_uss = bool(attrs.UseSectionStyles)
except Exception: post_uss = None
print("[OBERLEISTE] Plan-Mode UseSectionStyles pre={} post={}".format(
print("[TOOLBAR] Plan-Mode UseSectionStyles pre={} post={}".format(
pre_uss, post_uss))
# Clipping-Edges + Fills sichtbar
try: attrs.ShowClippingEdges = True
@@ -314,7 +314,7 @@ def _apply_dossier_plan_attrs(dmd):
try:
DisplayModeDescription.UpdateDisplayMode(dmd)
except Exception as ex:
print("[OBERLEISTE] Plan-Mode update:", ex)
print("[TOOLBAR] Plan-Mode update:", ex)
_TEMPLATES_DIR = os.path.join(_HERE, "templates")
@@ -336,11 +336,11 @@ def _ensure_dossier_display_mode(target_name, target_guid, template_basename,
template_basename: 'dossier_plan.ini' / 'dossier_3d.ini'
fallback_base_name: 'Technical' / 'Shaded' — Mode zum Klonen
"""
print("[OBERLEISTE] {}: check...".format(target_name))
print("[TOOLBAR] {}: check...".format(target_name))
try:
from Rhino.Display import DisplayModeDescription
except Exception as ex:
print("[OBERLEISTE] {}: DMD not available: {}".format(target_name, ex))
print("[TOOLBAR] {}: DMD not available: {}".format(target_name, ex))
return False
import re
template_ini_path = os.path.join(_TEMPLATES_DIR, template_basename)
@@ -353,7 +353,7 @@ def _ensure_dossier_display_mode(target_name, target_guid, template_basename,
# benutzen — wir nur neu importieren wenn sich die Template-Datei
# geaendert hat.
template_exists = os.path.isfile(template_ini_path)
print("[OBERLEISTE] {} template: {}".format(target_name,
print("[TOOLBAR] {} template: {}".format(target_name,
"found at " + template_ini_path if template_exists else "missing"))
# Fallback-Clone nur fuer "Dossier Plan" erlauben. Bei anderen Modes
# ohne Template skippen — sonst klonen wir z.B. den Raytraced-Mode mit
@@ -361,7 +361,7 @@ def _ensure_dossier_display_mode(target_name, target_guid, template_basename,
# und ALLE Modes nach Restart verschwinden lassen kann. User soll den
# Mode in Rhino bauen + per "Save As" -> templates/<basename> exportieren.
if not template_exists and target_name != "Dossier Plan":
print("[OBERLEISTE] {}: no template → skip (in Rhino bauen, "
print("[TOOLBAR] {}: no template → skip (in Rhino bauen, "
"Display-Mode -> Save As -> {})".format(
target_name, template_ini_path))
return False
@@ -380,7 +380,7 @@ def _ensure_dossier_display_mode(target_name, target_guid, template_basename,
# loeschen + reloaden wenn er das Template neu laden will.
# Vermeidet delete-loop wenn das Template ini-Werte hat die mein
# alter check als "falsch" einstufte.
print("[OBERLEISTE] Display mode: existing found, no action (delete manually to refresh)")
print("[TOOLBAR] Display mode: existing found, no action (delete manually to refresh)")
return True
# Sonst kein existing → vor dem Import alle Orphan-Modes mit unserer
# Guid ODER Namen "Dossier Plan" wegputzen (alte kaputte Versionen
@@ -401,14 +401,14 @@ def _ensure_dossier_display_mode(target_name, target_guid, template_basename,
DisplayModeDescription.DeleteDisplayMode(dm.Id)
cleanup_count += 1
except Exception as ex:
print("[OBERLEISTE] Plan-Mode cleanup delete fail:", ex)
print("[TOOLBAR] Plan-Mode cleanup delete fail:", ex)
if cleanup_count > 0:
print("[OBERLEISTE] Plan-Mode: {} Orphan-Mode(s) entfernt vor Import".format(
print("[TOOLBAR] Plan-Mode: {} Orphan-Mode(s) entfernt vor Import".format(
cleanup_count))
except Exception as ex:
print("[OBERLEISTE] Plan-Mode cleanup:", ex)
print("[TOOLBAR] Plan-Mode cleanup:", ex)
except Exception as ex:
print("[OBERLEISTE] Plan-Mode list:", ex)
print("[TOOLBAR] Plan-Mode list:", ex)
return False
# ----------------------------------------------------------------
# SOURCE: Template-ini bevorzugt (User hat den Mode manuell gebaut +
@@ -422,10 +422,10 @@ def _ensure_dossier_display_mode(target_name, target_guid, template_basename,
try:
with open(template_ini_path, "r", encoding="utf-8", errors="ignore") as f:
content = f.read()
print("[OBERLEISTE] {}: Template geladen ({} bytes)".format(
print("[TOOLBAR] {}: Template geladen ({} bytes)".format(
target_name, len(content)))
except Exception as ex:
print("[OBERLEISTE] {} Template read: {}".format(target_name, ex))
print("[TOOLBAR] {} Template read: {}".format(target_name, ex))
return False
else:
# Fallback: einen Base-Mode exportieren + patchen
@@ -440,21 +440,21 @@ def _ensure_dossier_display_mode(target_name, target_guid, template_basename,
except Exception: pass
if base is not None: break
if base is None:
print("[OBERLEISTE] Plan-Mode: kein Basis-Modus gefunden")
print("[TOOLBAR] Plan-Mode: kein Basis-Modus gefunden")
return False
try:
ok_export = False
try:
ok_export = bool(DisplayModeDescription.ExportToFile(base, tmp_path))
except Exception as ex:
print("[OBERLEISTE] Plan-Mode ExportToFile:", ex)
print("[TOOLBAR] Plan-Mode ExportToFile:", ex)
if not ok_export:
print("[OBERLEISTE] Plan-Mode: ExportToFile failed")
print("[TOOLBAR] Plan-Mode: ExportToFile failed")
return False
with open(tmp_path, "r", encoding="utf-8", errors="ignore") as f:
content = f.read()
except Exception as ex:
print("[OBERLEISTE] Plan-Mode fallback read ini:", ex)
print("[TOOLBAR] Plan-Mode fallback read ini:", ex)
return False
try:
@@ -479,10 +479,10 @@ def _ensure_dossier_display_mode(target_name, target_guid, template_basename,
content = content.replace(old_guid.upper(),
target_guid.upper())
else:
print("[OBERLEISTE] {}: kein DisplayMode-Section-Header "
print("[TOOLBAR] {}: kein DisplayMode-Section-Header "
"gefunden — Mode-Guid nicht ersetzt".format(target_name))
except Exception as ex:
print("[OBERLEISTE] {} Guid-Replace: {}".format(target_name, ex))
print("[TOOLBAR] {} Guid-Replace: {}".format(target_name, ex))
# Plan-Mode-Settings in der ini patchen — Rhino-DisplayMode-ini hat
# nested Sections wie [DisplayMode\<guid>\Objects\Surfaces]. Wir
# patchen nur EXISTIERENDE Keys (Rhino's Parser stripped unbekannte
@@ -518,27 +518,27 @@ def _ensure_dossier_display_mode(target_name, target_guid, template_basename,
try:
content, found = _ini_replace(content, key, val)
if found:
print("[OBERLEISTE] Plan-Mode ini {}={}".format(key, val))
print("[TOOLBAR] Plan-Mode ini {}={}".format(key, val))
except Exception as ex:
print("[OBERLEISTE] Plan-Mode ini-set {}={} fail: {}".format(
print("[TOOLBAR] Plan-Mode ini-set {}={} fail: {}".format(
key, val, ex))
try:
with open(tmp_path, "w", encoding="utf-8") as f:
f.write(content)
except Exception as ex:
print("[OBERLEISTE] Plan-Mode write ini:", ex)
print("[TOOLBAR] Plan-Mode write ini:", ex)
return False
# Import
try:
ok_import = bool(DisplayModeDescription.ImportFromFile(tmp_path))
except Exception as ex:
print("[OBERLEISTE] Plan-Mode ImportFromFile:", ex)
print("[TOOLBAR] Plan-Mode ImportFromFile:", ex)
return False
if not ok_import:
print("[OBERLEISTE] Plan-Mode: ImportFromFile gab False")
print("[TOOLBAR] Plan-Mode: ImportFromFile gab False")
return False
except Exception as ex:
print("[OBERLEISTE] Plan-Mode clone:", ex)
print("[TOOLBAR] Plan-Mode clone:", ex)
return False
# Neu importierten Mode holen + tweaken
try:
@@ -553,14 +553,14 @@ def _ensure_dossier_display_mode(target_name, target_guid, template_basename,
dmd = dm; break
except Exception: pass
if dmd is None:
print("[OBERLEISTE] Plan-Mode: nach Import not found")
print("[TOOLBAR] Plan-Mode: nach Import not found")
return False
# KEIN _apply_dossier_plan_attrs() hier — der wuerde
# UpdateDisplayMode() aufrufen und die ini-Werte (ClipSectionUsage,
# TechnicalMask) mit den Python-Default-Attrs ueberschreiben.
# Die ini hat schon alle richtigen Werte.
src = "Template" if template_exists else (base.EnglishName if base else "?")
print("[OBERLEISTE] Display-Mode 'Dossier Plan' angelegt (Basis: {})".format(src))
print("[TOOLBAR] Display-Mode 'Dossier Plan' angelegt (Basis: {})".format(src))
# Sanity-Check: liste alle Display-Modes auf damit wir sehen ob unser
# Mode wirklich registriert ist (und mit welchem Namen).
try:
@@ -569,7 +569,7 @@ def _ensure_dossier_display_mode(target_name, target_guid, template_basename,
try:
names.append(dm_check.EnglishName)
except Exception: pass
print("[OBERLEISTE] Plan-Mode: alle registrierten Modes: {}".format(
print("[TOOLBAR] Plan-Mode: alle registrierten Modes: {}".format(
", ".join(names)))
except Exception: pass
# Cache invalidieren damit das Dropdown ihn sieht
@@ -579,7 +579,7 @@ def _ensure_dossier_display_mode(target_name, target_guid, template_basename,
except Exception: pass
return True
except Exception as ex:
print("[OBERLEISTE] Plan-Mode tweak:", ex)
print("[TOOLBAR] Plan-Mode tweak:", ex)
return False
@@ -600,24 +600,24 @@ def _save_thumbnail(doc):
import System.Drawing as _sd
size = _sd.Size(int(w), int(h))
except Exception as ex:
print("[OBERLEISTE] thumb size:", ex); return
print("[TOOLBAR] thumb size:", ex); return
try:
bmp = view.CaptureToBitmap(size)
except Exception as ex:
print("[OBERLEISTE] CaptureToBitmap:", ex); return
print("[TOOLBAR] CaptureToBitmap:", ex); return
if bmp is None: return
thumb_path = doc_path + ".thumb.png"
try:
import System.Drawing.Imaging as _imaging
bmp.Save(thumb_path, _imaging.ImageFormat.Png)
print("[OBERLEISTE] Thumb gespeichert:", thumb_path)
print("[TOOLBAR] Thumb gespeichert:", thumb_path)
except Exception as ex:
print("[OBERLEISTE] Thumb-Save:", ex)
print("[TOOLBAR] Thumb-Save:", ex)
finally:
try: bmp.Dispose()
except Exception: pass
except Exception as ex:
print("[OBERLEISTE] _save_thumbnail Fehler:", ex)
print("[TOOLBAR] _save_thumbnail Fehler:", ex)
def _launch_dossier_app():
@@ -637,17 +637,17 @@ def _launch_dossier_app():
if os.path.isdir(ap):
try:
_subprocess.Popen(["open", ap])
print("[OBERLEISTE] Dossier-Launcher gestartet:", ap)
print("[TOOLBAR] Dossier-Launcher gestartet:", ap)
return True
except Exception as ex:
print("[OBERLEISTE] open Dossier-App ({}):".format(ap), ex)
print("[TOOLBAR] open Dossier-App ({}):".format(ap), ex)
# Letzter Versuch: per App-Name (sucht in /Applications)
try:
_subprocess.Popen(["open", "-a", "Dossier"])
print("[OBERLEISTE] Dossier via 'open -a Dossier' gestartet")
print("[TOOLBAR] Dossier via 'open -a Dossier' gestartet")
return True
except Exception as ex:
print("[OBERLEISTE] open -a Dossier:", ex)
print("[TOOLBAR] open -a Dossier:", ex)
return False
@@ -685,7 +685,7 @@ def _list_window_layouts():
for n in names:
if n and n not in out: out.append(str(n))
if out:
print("[OBERLEISTE] Layouts via API.{}: {}".format(attr, out))
print("[TOOLBAR] Layouts via API.{}: {}".format(attr, out))
return out
except Exception: continue
except Exception: pass
@@ -706,9 +706,9 @@ def _list_window_layouts():
name = _extract_layout_name_from_xml(content)
if name and name not in out: out.append(name)
if out:
print("[OBERLEISTE] {} Layouts via XML gefunden".format(len(out)))
print("[TOOLBAR] {} Layouts via XML gefunden".format(len(out)))
except Exception as ex:
print("[OBERLEISTE] workspaces-scan:", ex)
print("[TOOLBAR] workspaces-scan:", ex)
# 3) Legacy .rwl-Pfade (Windows + ggf. aeltere Rhino-Versionen)
candidate_dirs = [
@@ -731,7 +731,7 @@ def _list_window_layouts():
except Exception: continue
if not out:
print("[OBERLEISTE] Keine Layouts gefunden.")
print("[TOOLBAR] Keine Layouts gefunden.")
return out
@@ -756,7 +756,7 @@ def _layout_name_to_guid(name):
if xn and xn.strip().lower() == target:
return os.path.splitext(fn)[0]
except Exception as ex:
print("[OBERLEISTE] name_to_guid:", ex)
print("[TOOLBAR] name_to_guid:", ex)
return None
@@ -786,7 +786,7 @@ def _rhino_last_restored_layout_guid():
txt)
if m: return m.group(1).strip().lower()
except Exception as ex:
print("[OBERLEISTE] last-restored read:", ex)
print("[TOOLBAR] last-restored read:", ex)
return None
@@ -806,7 +806,7 @@ def _is_layout_recently_applied(name, max_age_sec=600):
except Exception: return False
return 0 <= age <= max_age_sec
except Exception as ex:
print("[OBERLEISTE] layout-marker read:", ex)
print("[TOOLBAR] layout-marker read:", ex)
return False
@@ -824,7 +824,7 @@ def _mark_layout_applied(name):
"appliedAt": _t.time(),
}, ensure_ascii=False).encode("utf-8"))
except Exception as ex:
print("[OBERLEISTE] layout-marker write:", ex)
print("[TOOLBAR] layout-marker write:", ex)
def _apply_window_layout(name):
@@ -836,7 +836,7 @@ def _apply_window_layout(name):
(siehe _is_layout_recently_applied).
"""
if not name:
print("[OBERLEISTE] apply_window_layout: leerer Name")
print("[TOOLBAR] apply_window_layout: leerer Name")
return False
# KEIN Content-Skip mehr: Mac Rhino's Auto-Restore aus LastRestoredWindow
# Layout dockt Eto-WebView-Panels NICHT korrekt — sie spawnen floating in
@@ -859,7 +859,7 @@ def _apply_window_layout(name):
def _apply_window_layout_impl(name):
guid = _layout_name_to_guid(name)
print("[OBERLEISTE] apply_window_layout: name='{}' guid='{}'".format(
print("[TOOLBAR] apply_window_layout: name='{}' guid='{}'".format(
name, guid))
# 1) Direkt ueber Rhino.UI-API per Reflection. Wir loggen WAS gefunden
@@ -877,10 +877,10 @@ def _apply_window_layout_impl(name):
if meth is not None:
api_candidates.append((cls_name, meth_name, meth))
if api_candidates:
print("[OBERLEISTE] API-Kandidaten gefunden:", len(api_candidates),
print("[TOOLBAR] API-Kandidaten gefunden:", len(api_candidates),
[(c, m) for c, m, _ in api_candidates])
else:
print("[OBERLEISTE] No Rhino.UI API candidates (Mac Rhino "
print("[TOOLBAR] No Rhino.UI API candidates (Mac Rhino "
"exposed das nicht statisch). Falling back to scripted commands.")
# Args zum Probieren: GUID zuerst (falls present) dann Name.
# Beide als 1-arg Tuple. Doppelte Klammern haben in der alten Version
@@ -892,13 +892,13 @@ def _apply_window_layout_impl(name):
for arg in arg_variants:
try:
res = meth(*arg)
print("[OBERLEISTE] apply via Rhino.UI.{}.{}({!r}) -> {}".format(
print("[TOOLBAR] apply via Rhino.UI.{}.{}({!r}) -> {}".format(
cls_name, meth_name, arg[0], res))
return True
except Exception:
continue
except Exception as ex:
print("[OBERLEISTE] API-Path Fehler:", ex)
print("[TOOLBAR] API-Path Fehler:", ex)
# 2) Scripted Rhino-Commands. STOP on success — RunScript liefert bool.
# Beobachtung aus Mac Rhino 8 Logs: _-WindowLayout "<name>" _Enter wirft
@@ -915,10 +915,10 @@ def _apply_window_layout_impl(name):
try: Rhino.RhinoApp.SendKeystrokes("\x1b", False)
except Exception: pass
res = Rhino.RhinoApp.RunScript(cmd, False)
print("[OBERLEISTE] RunScript({!r}) -> {}".format(cmd, res))
print("[TOOLBAR] RunScript({!r}) -> {}".format(cmd, res))
return bool(res)
except Exception as ex:
print("[OBERLEISTE] RunScript-Fehler ({}): {}".format(cmd, ex))
print("[TOOLBAR] RunScript-Fehler ({}): {}".format(cmd, ex))
return False
quoted = '"{}"'.format(name.replace('"', ''))
@@ -930,10 +930,10 @@ def _apply_window_layout_impl(name):
]
for cmd in cmd_candidates:
if _try_cmd(cmd):
print("[OBERLEISTE] Command succeeded, stopping.")
print("[TOOLBAR] Command succeeded, stopping.")
return True
print("[OBERLEISTE] apply_window_layout: kein Weg hat funktioniert. "
print("[TOOLBAR] apply_window_layout: kein Weg hat funktioniert. "
"Wenn das Layout im Rhino-UI bekannt ist aber hier nicht greift, "
"manuell via Window-Menue zu wechseln.")
return False
@@ -948,7 +948,7 @@ def open_settings_dialog():
import Eto.Forms as _ef
import Eto.Drawing as _ed
except Exception as ex:
print("[OBERLEISTE] Eto-Import failed:", ex); return
print("[TOOLBAR] Eto-Import failed:", ex); return
cfg = _settings_load()
layouts = _list_window_layouts()
@@ -1072,7 +1072,7 @@ def open_settings_dialog():
dlg.Content = layout
try: dlg.Show()
except Exception as ex:
print("[OBERLEISTE] Settings-Dialog Show:", ex)
print("[TOOLBAR] Settings-Dialog Show:", ex)
def _get_active_viewport_name():
@@ -1121,7 +1121,7 @@ def _list_all_command_names():
"Properties","Layer","Snap","Ortho","Planar","Save","SaveAs"):
names.add(n)
out = sorted(names)
print("[OBERLEISTE] {} Rhino commands enumerated for autocomplete".format(len(out)))
print("[TOOLBAR] {} Rhino commands enumerated for autocomplete".format(len(out)))
return out
@@ -1188,7 +1188,7 @@ def _list_display_modes():
except Exception:
continue
except Exception as ex:
print("[OBERLEISTE] _list_display_modes:", ex)
print("[TOOLBAR] _list_display_modes:", ex)
_display_modes_cache = out
return out
@@ -1202,10 +1202,10 @@ def _set_display_mode(name):
if dm.LocalName == name or dm.EnglishName == name:
v.ActiveViewport.DisplayMode = dm
v.Redraw()
print("[OBERLEISTE] Display-Mode: {}".format(name))
print("[TOOLBAR] Display-Mode: {}".format(name))
return True
except Exception as ex:
print("[OBERLEISTE] _set_display_mode:", ex)
print("[TOOLBAR] _set_display_mode:", ex)
return False
@@ -1251,7 +1251,7 @@ def _set_osnap_mode(key, enabled):
new = (cur | flag_i) if enabled else (cur & ~flag_i)
s.OsnapModes = Rhino.ApplicationSettings.OsnapModes(new)
except Exception as ex:
print("[OBERLEISTE] _set_osnap_mode:", ex)
print("[TOOLBAR] _set_osnap_mode:", ex)
def _is_grid_visible():
@@ -1306,14 +1306,14 @@ def _set_ortho(v):
try:
Rhino.ApplicationSettings.ModelAidSettings.Ortho = bool(v)
except Exception as ex:
print("[OBERLEISTE] _set_ortho:", ex)
print("[TOOLBAR] _set_ortho:", ex)
def _set_grid_snap(v):
try:
Rhino.ApplicationSettings.ModelAidSettings.GridSnap = bool(v)
except Exception as ex:
print("[OBERLEISTE] _set_grid_snap:", ex)
print("[TOOLBAR] _set_grid_snap:", ex)
def _set_osnap_master(v):
@@ -1326,7 +1326,7 @@ def _set_osnap_master(v):
setattr(s, attr, bool(v))
return
except Exception as ex:
print("[OBERLEISTE] _set_osnap_master:", ex)
print("[TOOLBAR] _set_osnap_master:", ex)
# --- Bridge -----------------------------------------------------------------
@@ -1358,7 +1358,7 @@ class OberleisteBridge(panel_base.BaseBridge):
try:
self._all_commands = _list_all_command_names()
except Exception as ex:
print("[OBERLEISTE] command-enum:", ex)
print("[TOOLBAR] command-enum:", ex)
self._all_commands = []
# Sofort an UI pushen (Autocomplete wird live)
try:
@@ -1368,7 +1368,7 @@ class OberleisteBridge(panel_base.BaseBridge):
except Exception: pass
try: Rhino.RhinoApp.Idle += _load_once
except Exception as ex:
print("[OBERLEISTE] schedule command-load:", ex)
print("[TOOLBAR] schedule command-load:", ex)
self._commands_loading = False
def _on_ready(self):
@@ -1401,7 +1401,7 @@ class OberleisteBridge(panel_base.BaseBridge):
if _apply_viewport_colors(cfg):
sc.sticky["_dossier_view_colors_applied"] = True
except Exception as ex:
print("[OBERLEISTE] auto-apply (layout/colors):", ex)
print("[TOOLBAR] auto-apply (layout/colors):", ex)
# Splash-Screen (falls noch offen) jetzt wegmachen — Layout-Apply ist
# durch, Panels sind in finaler Position. hide() dispatcht intern
# auf Main-Thread via Rhino.Idle (Mac-safe).
@@ -1409,7 +1409,7 @@ class OberleisteBridge(panel_base.BaseBridge):
import _startup_splash as _ss
_ss.hide()
except Exception as ex:
print("[OBERLEISTE] splash hide:", ex)
print("[TOOLBAR] splash hide:", ex)
self._send_state(force=True)
def handle(self, data):
@@ -1449,7 +1449,7 @@ class OberleisteBridge(panel_base.BaseBridge):
try:
self._sync_referenz_for_print(doc, enabled)
except Exception as ex:
print("[OBERLEISTE] sync referenz for print:", ex)
print("[TOOLBAR] sync referenz for print:", ex)
self._send_state(force=True)
elif t == "SET_DPI":
doc, _ = massstab._active_vp()
@@ -1472,19 +1472,19 @@ class OberleisteBridge(panel_base.BaseBridge):
try:
import kamera
kamera.set_top_view(vp); handled = True
except Exception as ex: print("[OBERLEISTE] top:", ex)
except Exception as ex: print("[TOOLBAR] top:", ex)
elif v == "Perspective":
_run("_-{} _Enter".format(v)); handled = True
elif v == "Iso":
try:
import kamera
kamera._set_iso(vp, "NE"); handled = True
except Exception as ex: print("[OBERLEISTE] iso:", ex)
except Exception as ex: print("[TOOLBAR] iso:", ex)
elif v in ("N", "O", "S", "W"):
try:
import kamera
kamera.set_cardinal_view(vp, v); handled = True
except Exception as ex: print("[OBERLEISTE] cardinal:", ex)
except Exception as ex: print("[TOOLBAR] cardinal:", ex)
elif v in ("Front", "Right", "Left", "Back", "Bottom"):
_run("_-{} _Enter".format(v)); handled = True
if handled:
@@ -1497,7 +1497,7 @@ class OberleisteBridge(panel_base.BaseBridge):
import kamera
kamera.open_as_window()
except Exception as ex:
print("[OBERLEISTE] open kamera:", ex)
print("[TOOLBAR] open kamera:", ex)
# --- About-Fenster ----------------------------------------------
elif t == "OPEN_ABOUT":
@@ -1505,7 +1505,7 @@ class OberleisteBridge(panel_base.BaseBridge):
import about
about.open_as_window()
except Exception as ex:
print("[OBERLEISTE] open about:", ex)
print("[TOOLBAR] open about:", ex)
# --- Cheatsheet (Shortcuts-Uebersicht) --------------------------
elif t == "OPEN_CHEATSHEET":
@@ -1513,7 +1513,7 @@ class OberleisteBridge(panel_base.BaseBridge):
import welcome
welcome.show_cheatsheet()
except Exception as ex:
print("[OBERLEISTE] open cheatsheet:", ex)
print("[TOOLBAR] open cheatsheet:", ex)
# --- Text-Erstellung (Floating-Input) ---------------------------
elif t == "CREATE_TEXT":
@@ -1521,7 +1521,7 @@ class OberleisteBridge(panel_base.BaseBridge):
import text_create
text_create.create_text()
except Exception as ex:
print("[OBERLEISTE] create text:", ex)
print("[TOOLBAR] create text:", ex)
elif t == "SET_TEXT_SETTINGS":
try:
import text_create
@@ -1530,7 +1530,7 @@ class OberleisteBridge(panel_base.BaseBridge):
text_create.save_settings(doc, patch)
text_create.apply_settings_to_selection(doc, patch)
except Exception as ex:
print("[OBERLEISTE] text settings:", ex)
print("[TOOLBAR] text settings:", ex)
self._send_state(force=True)
elif t == "APPLY_TEXT_STYLE":
try:
@@ -1538,7 +1538,7 @@ class OberleisteBridge(panel_base.BaseBridge):
text_create.apply_style(
Rhino.RhinoDoc.ActiveDoc, p.get("id"))
except Exception as ex:
print("[OBERLEISTE] apply text style:", ex)
print("[TOOLBAR] apply text style:", ex)
self._send_state(force=True)
elif t == "SAVE_TEXT_STYLE":
try:
@@ -1547,7 +1547,7 @@ class OberleisteBridge(panel_base.BaseBridge):
sid = text_create.save_style(doc, p.get("name") or "Stil")
if sid: text_create.set_active_style_id(doc, sid)
except Exception as ex:
print("[OBERLEISTE] save text style:", ex)
print("[TOOLBAR] save text style:", ex)
self._send_state(force=True)
elif t == "DELETE_TEXT_STYLE":
try:
@@ -1555,7 +1555,7 @@ class OberleisteBridge(panel_base.BaseBridge):
text_create.delete_style(
Rhino.RhinoDoc.ActiveDoc, p.get("id"))
except Exception as ex:
print("[OBERLEISTE] delete text style:", ex)
print("[TOOLBAR] delete text style:", ex)
self._send_state(force=True)
# --- Masse (Mass-Style) -----------------------------------------
@@ -1566,30 +1566,30 @@ class OberleisteBridge(panel_base.BaseBridge):
mass_style.set_active_id(doc, p.get("id"))
mass_style.regen_all_rooms(doc)
except Exception as ex:
print("[OBERLEISTE] masse active:", ex)
print("[TOOLBAR] masse active:", ex)
self._send_state(force=True)
elif t == "OPEN_MASSE_SETTINGS":
try:
import masse_settings
masse_settings.open_as_window()
except Exception as ex:
print("[OBERLEISTE] open masse:", ex)
print("[TOOLBAR] open masse:", ex)
elif t == "OPEN_PROJECT_SETTINGS":
# Delegiert an EBENEN-Bridge (sie haelt die Satellite-Logik fuer
# Projekt-Settings + Library).
try:
eb = sc.sticky.get("ebenen_bridge_ref")
if eb is not None: eb._open_project_settings()
else: print("[OBERLEISTE] open project-settings: ebenen_bridge_ref nicht da")
else: print("[TOOLBAR] open project-settings: ebenen_bridge_ref nicht da")
except Exception as ex:
print("[OBERLEISTE] open project-settings:", ex)
print("[TOOLBAR] open project-settings:", ex)
elif t == "OPEN_LIBRARY":
try:
eb = sc.sticky.get("ebenen_bridge_ref")
if eb is not None: eb._open_library()
else: print("[OBERLEISTE] open library: ebenen_bridge_ref nicht da")
else: print("[TOOLBAR] open library: ebenen_bridge_ref nicht da")
except Exception as ex:
print("[OBERLEISTE] open library:", ex)
print("[TOOLBAR] open library:", ex)
# --- Darstellung (SIA-400 LoD globaler Override) -----------------
elif t == "SET_DARSTELLUNG":
@@ -1600,7 +1600,7 @@ class OberleisteBridge(panel_base.BaseBridge):
elemente.set_aktive_darstellung(doc, new_v)
elemente.regenerate_all_oeffnungen(doc)
except Exception as ex:
print("[OBERLEISTE] set darstellung:", ex)
print("[TOOLBAR] set darstellung:", ex)
self._send_state(force=True)
# --- Display-Mode -----------------------------------------------
@@ -1646,7 +1646,7 @@ class OberleisteBridge(panel_base.BaseBridge):
if b is not None:
b._send_state()
except Exception as ex:
print("[OBERLEISTE] notify overrides:", ex)
print("[TOOLBAR] notify overrides:", ex)
elif t == "SAVE_OVERRIDES_PRESET":
# Quick-Save direkt aus der Topbar: aktuelle Doc-Rules unter
# gegebenem Namen ablegen und sofort als activePreset markieren.
@@ -1667,13 +1667,13 @@ class OberleisteBridge(panel_base.BaseBridge):
if b is not None:
b._send_state()
except Exception as ex:
print("[OBERLEISTE] notify overrides:", ex)
print("[TOOLBAR] notify overrides:", ex)
elif t == "OPEN_OVERRIDES_PANEL":
try:
import overrides_panel
overrides_panel.open_as_window()
except Exception as ex:
print("[OBERLEISTE] open_as_window Overrides:", ex)
print("[TOOLBAR] open_as_window Overrides:", ex)
# --- Ebenenkombinationen ----------------------------------------
elif t == "PICK_LAYER_COMBINATION":
@@ -1701,7 +1701,7 @@ class OberleisteBridge(panel_base.BaseBridge):
elif t == "OPEN_LAYER_COMBINATIONS_DIALOG":
try: rhinopanel.open_layer_combinations_window()
except Exception as ex:
print("[OBERLEISTE] open layer-combinations:", ex)
print("[TOOLBAR] open layer-combinations:", ex)
# --- Referenzlinien-Sichtbarkeit togglen ------------------------
# Shortcut fuer die Layer-Sichtbarkeit der Referenzlinien-Ebene
@@ -1713,7 +1713,7 @@ class OberleisteBridge(panel_base.BaseBridge):
doc = Rhino.RhinoDoc.ActiveDoc
if doc is None: return
want_visible = bool(p.get("visible"))
print("[OBERLEISTE] TOGGLE_REFERENZLINIEN -> {}".format(want_visible))
print("[TOOLBAR] TOGGLE_REFERENZLINIEN -> {}".format(want_visible))
# Keyword-driven: alle Ebenen mit Namen 'Referenz' im JSON
# finden (rekursiv), deren Codes sammeln, dann ALLE Rhino-
@@ -1747,7 +1747,7 @@ class OberleisteBridge(panel_base.BaseBridge):
doc.Strings.SetString("dossier_ebenen",
_json.dumps(ebenen, ensure_ascii=False))
except Exception: pass
print("[OBERLEISTE] Referenz-Codes gefunden: {}".format(codes))
print("[TOOLBAR] Referenz-Codes gefunden: {}".format(codes))
# Rhino-Layer fuer jeden Code toggeln (Praefix-Match)
n_toggled = 0
@@ -1763,7 +1763,7 @@ class OberleisteBridge(panel_base.BaseBridge):
doc.Layers.Modify(layer, i, True)
n_toggled += 1
except Exception: pass
print("[OBERLEISTE] {} Rhino-Layer getoggelt".format(n_toggled))
print("[TOOLBAR] {} Rhino-Layer getoggelt".format(n_toggled))
try: doc.Views.Redraw()
except Exception: pass
@@ -1771,7 +1771,7 @@ class OberleisteBridge(panel_base.BaseBridge):
rhinopanel._broadcast_state(doc)
self._send_state(force=True)
except Exception as ex:
print("[OBERLEISTE] TOGGLE_REFERENZLINIEN:", ex)
print("[TOOLBAR] TOGGLE_REFERENZLINIEN:", ex)
# --- Anordnen (DisplayOrder Z-Stack) ----------------------------
# Nutzt Rhinos native _BringToFront / _BringForward / _SendBackward
@@ -1797,7 +1797,7 @@ class OberleisteBridge(panel_base.BaseBridge):
Rhino.RhinoApp.SendKeystrokes("\x1b", False)
Rhino.RhinoApp.RunScript(cmd, False)
except Exception as ex:
print("[OBERLEISTE] arrange {}: {}".format(cmd, ex))
print("[TOOLBAR] arrange {}: {}".format(cmd, ex))
# --- Command-Line Integration -----------------------------------
elif t == "RUN_COMMAND":
@@ -1815,7 +1815,7 @@ class OberleisteBridge(panel_base.BaseBridge):
Rhino.RhinoApp.SendKeystrokes("\x1b", False)
Rhino.RhinoApp.RunScript(cmd, False)
except Exception as ex:
print("[OBERLEISTE] RunScript-Fehler:", ex)
print("[TOOLBAR] RunScript-Fehler:", ex)
elif t == "SEND_KEYS":
text = p.get("text") or ""
append_enter = bool(p.get("enter", True))
@@ -1825,7 +1825,7 @@ class OberleisteBridge(panel_base.BaseBridge):
Rhino.RhinoApp.SendKeystrokes("\x1b", False)
Rhino.RhinoApp.SendKeystrokes(text, append_enter)
except Exception as ex:
print("[OBERLEISTE] SendKeystrokes-Fehler:", ex)
print("[TOOLBAR] SendKeystrokes-Fehler:", ex)
elif t == "CANCEL_COMMAND":
try:
# Doppel-ESC: einmal um Eingabe-Buffer zu clearen, einmal um
@@ -1927,7 +1927,7 @@ class OberleisteBridge(panel_base.BaseBridge):
sc.sticky[key] = snap
try: doc.Views.Redraw()
except Exception: pass
print("[OBERLEISTE] Print AN: {} Referenz-Layer ausgeblendet".format(len(snap)))
print("[TOOLBAR] Print AN: {} Referenz-Layer ausgeblendet".format(len(snap)))
else:
# Restore
snap = sc.sticky.get(key) or {}
@@ -1946,7 +1946,7 @@ class OberleisteBridge(panel_base.BaseBridge):
except Exception: pass
try: doc.Views.Redraw()
except Exception: pass
print("[OBERLEISTE] Print AUS: {} Referenz-Layer-Sichtbarkeit restored".format(n))
print("[TOOLBAR] Print AUS: {} Referenz-Layer-Sichtbarkeit restored".format(n))
def _send_state(self, force=False):
doc, vp = massstab._active_vp()
@@ -2116,10 +2116,10 @@ class OberleisteBridge(panel_base.BaseBridge):
# Re-Apply vom Launcher-Pending — sonst triggert es eine
# zweite Re-Mount-Welle ALLER Panels.
if sc.sticky.get("_dossier_layout_applied"):
print("[OBERLEISTE] pendingApplyLayout '{}' — Cold-Start "
print("[TOOLBAR] pendingApplyLayout '{}' — Cold-Start "
"hat in dieser Session bereits applied, skip".format(pend_layout))
else:
print("[OBERLEISTE] pendingApplyLayout:", pend_layout)
print("[TOOLBAR] pendingApplyLayout:", pend_layout)
_apply_window_layout(pend_layout)
sc.sticky["_dossier_layout_applied"] = True
cfg.pop("pendingApplyLayout", None)
@@ -2127,14 +2127,14 @@ class OberleisteBridge(panel_base.BaseBridge):
if cfg.get("pendingApplyViewColors"):
if _apply_viewport_colors(cfg):
print("[OBERLEISTE] pendingApplyViewColors: applied")
print("[TOOLBAR] pendingApplyViewColors: applied")
cfg["pendingApplyViewColors"] = False
mutated = True
modes = cfg.get("pendingImportDisplayModes") or []
if isinstance(modes, list) and modes:
n = _import_display_modes(modes)
print("[OBERLEISTE] pendingImportDisplayModes: {} importiert".format(n))
print("[TOOLBAR] pendingImportDisplayModes: {} importiert".format(n))
cfg["pendingImportDisplayModes"] = []
mutated = True
@@ -2164,21 +2164,21 @@ class OberleisteBridge(panel_base.BaseBridge):
})
if clean:
cfg["layerSchema"] = clean
print("[OBERLEISTE] Ebenen-Export: {} Sublayer "
print("[TOOLBAR] Ebenen-Export: {} Sublayer "
"ins Launcher-Schema geschrieben".format(len(clean)))
else:
print("[OBERLEISTE] Ebenen-Export: doc.Strings hatte "
print("[TOOLBAR] Ebenen-Export: doc.Strings hatte "
"keine gueltigen Ebenen")
else:
print("[OBERLEISTE] Ebenen-Export: doc.Strings ['dossier_ebenen'] leer")
print("[TOOLBAR] Ebenen-Export: doc.Strings ['dossier_ebenen'] leer")
except Exception as ex:
print("[OBERLEISTE] Ebenen-Export Fehler:", ex)
print("[TOOLBAR] Ebenen-Export Fehler:", ex)
cfg["pendingExportEbenen"] = False
mutated = True
if mutated: _settings_save(cfg)
except Exception as ex:
print("[OBERLEISTE] check_pending_launcher_signals:", ex)
print("[TOOLBAR] check_pending_launcher_signals:", ex)
def tick_idle(self):
# Command-Prompt aendert sich oft schnell -> separater Pfad: wenn sich
@@ -2227,7 +2227,7 @@ def _open_dossier_settings_panel():
)
sc.sticky["_dossier_settings_form"] = form
except Exception as ex:
print("[OBERLEISTE] open_dossier_settings_panel:", ex)
print("[TOOLBAR] open_dossier_settings_panel:", ex)
def _reload_all_panel_langs():
@@ -2241,9 +2241,9 @@ def _reload_all_panel_langs():
try:
panel_base.load_inline(val._wv, val.mode)
except Exception as ex:
print("[OBERLEISTE] reload_lang ({}): {}".format(key, ex))
print("[TOOLBAR] reload_lang ({}): {}".format(key, ex))
except Exception as ex:
print("[OBERLEISTE] _reload_all_panel_langs:", ex)
print("[TOOLBAR] _reload_all_panel_langs:", ex)
# --- Listener-Hookup --------------------------------------------------------
@@ -2273,14 +2273,14 @@ def _install_listeners(bridge):
doc = getattr(e, "Document", None) or Rhino.RhinoDoc.ActiveDoc
_save_thumbnail(doc)
except Exception as ex:
print("[OBERLEISTE] on_end_save:", ex)
print("[TOOLBAR] on_end_save:", ex)
Rhino.RhinoApp.Idle += on_idle
Rhino.RhinoDoc.ActiveDocumentChanged += on_view_change
try: Rhino.RhinoDoc.EndSaveDocument += on_end_save
except Exception as ex: print("[OBERLEISTE] EndSaveDocument-Hook:", ex)
except Exception as ex: print("[TOOLBAR] EndSaveDocument-Hook:", ex)
sc.sticky[flag] = True
print("[OBERLEISTE] Listener active")
print("[TOOLBAR] Listener active")
def _bridge_factory():
@@ -2299,7 +2299,7 @@ for _name, _guid, _tmpl, _fallback in _DOSSIER_DISPLAY_MODES:
try:
_ensure_dossier_display_mode(_name, _guid, _tmpl, _fallback)
except Exception as _ex:
print("[OBERLEISTE] ensure {}: {}".format(_name, _ex))
print("[TOOLBAR] ensure {}: {}".format(_name, _ex))
try:
panel_base._t_mark("display_modes", "oberleiste", _t_dm_start)
except Exception: pass