Files
DOSSIER/rhino/_inspect_plan_mode.py
karim 13a5e1eb7a AGPL-3.0 Dual-Lizenz + Pill-Stil-UI + Section-Style-Overhaul + Plan-Mode-Template
Lizenz:
- AGPL-3.0 LICENSE-File im Repo-Root (GNU Volltext)
- SPDX-Header + Copyright in allen Source-Files (Python/JSX/JS/Rust)
- license-Feld in package.json + Cargo.toml
- About-App komplett neu: Dual-Lizenz-Block (AGPL + Commercial),
  openbureau-Branding, Version-Pills, made-in-Switzerland-Footer

UI-Restyle (3 Wellen) — alle Dialoge + Satellites + Panel-Sidebars
auf gemeinsamen Pill-Stil aus BarControls (BarToggle/BarButton/BarCombo):
- Welle 1: GeschossDialog/Settings, AusschnittSettings, LayoutDialog
- Welle 2: ConfirmDeleteEbene, Kamera, MasseSettings, Osm, Swisstopo,
  TextEditor, AusschnittLayerDialog, LayerCombinations
- Welle 3: LayoutsApp, MassstabApp, WerkzeugeApp, OverridesApp,
  ZeichnungsebenenApp; Werkzeuge mit ElementeApp-PillGroup-Layout

GeschossDialog Header-Refactor: +Geschoss/+Zeichnung in Toolbar oben,
move-Pfeile-Spalte breiter (kein Overlap mit G-Haken)

Ausschnitte Rows als Pills, kein Outer-Border ums Suchfeld

Section-Style komplett neu (gestaltung.py + GestaltungApp.jsx):
- ObjectSectionAttributesSource.FromObject (richtiger Enum-Name fuer Mac)
- HatchPatternPrintColor + BoundaryPrintColor mit-setzen (Display = Print)
- BoundaryColor nur bei explizitem User-Override, sonst Rhino-Default
- background_color_hex Parameter (BackgroundFillMode=SolidColor)
- Readback aus GetCustomSectionStyle statt direkt aus Attributes
- UI: Schnittkante > Section Style > Solid-Fill mit proper SectionHead
- 'Boundary' (3D Pen) -> 'Background' weil sich's wie Section-Hintergrund verhaelt

Plan-Mode 'Dossier Plan' via Template:
- rhino/templates/dossier_plan.ini wird direkt geladen
- Fallback auf Technical-Clone + ini-Patch wenn Template fehlt
- Auto-Cleanup von Orphan-Modes vor Import (Name- oder Guid-Match)
- ClipSectionUsage=1 + TechnicalMask=15 als bekannte Soll-Werte
- Bei Template-Pfad keine ini-Patches (1:1 wie User exportiert)
- Sanity-Print listet alle registrierten Modes nach Anlegen

Bridge-Unification: 4 Settings-Apps (Ebenen/Project/Geschoss*Dialog)
benutzen jetzt chunkende send() statt eigene bridgeSend ohne Chunk-
Logik -> grosse Payloads (Hatch-Refs etc.) kommen nicht mehr truncated
bei Python an (loeste 'JSON-Fehler char 990'-Regression in Ebenen-
Settings)

Library-Imports robust: 'import library' jetzt Top-Level in elemente.py
+ rhinopanel.py (statt Lazy in Methoden) -> 'No module named library'-
Crashes weg auch wenn sys.path zwischendurch resettet wird

Tools fuer Display-Mode-Maintenance:
- _clean_display_modes.py (loescht alle Custom-Modes, Built-ins bleiben)
- _inspect_plan_mode.py / _inspect_obj_section.py / _inspect_obj_boundary.py
  (Diagnose-Skripte fuer SectionStyle-Property-Reverse-Engineering)
- _reset_rhino_settings.sh (Backup + Nuke der Rhino-Settings als
  letzte Bastion gegen korrupte Display-Modes)
2026-05-26 17:09:18 +02:00

97 lines
3.7 KiB
Python

#! python3
# SPDX-License-Identifier: AGPL-3.0-or-later
# Copyright (C) 2026 Karim Gabriele Varano
"""One-Shot-Diagnose: dumpt alle Properties + Werte des 'Dossier Plan'
Display-Modes und exportiert ihn als ini neben dem Skript.
Vorgehen:
1. In Rhinos Display-Mode-Editor: 'Show HiddenLines' AUS schalten +
Apply
2. _RunPythonScript /Users/karim/STUDIO/DOSSIER/rhino/_inspect_plan_mode.py
3. Resultat: zeigt alle Hidden/Tangent/Silhouette-Properties +
/tmp/dossier_plan_inspect.ini
So koennen wir sehen welche Property-Namen Mac Rhino tatsaechlich hat.
"""
import os
from Rhino.Display import DisplayModeDescription
target_name = "Dossier Plan"
dmd = None
for dm in DisplayModeDescription.GetDisplayModes():
if dm.EnglishName == target_name or dm.LocalName == target_name:
dmd = dm; break
if dmd is None:
print("[INSPECT] 'Dossier Plan' nicht gefunden")
else:
attrs = dmd.DisplayAttributes
print("[INSPECT] Mode gefunden: {} (Id={})".format(dmd.EnglishName, dmd.Id))
print("")
print("=== ALLE DisplayAttributes Properties mit Werten ===")
for n in sorted(dir(attrs)):
if n.startswith("_"): continue
try:
v = getattr(attrs, n)
if callable(v): continue
sv = str(v)
if len(sv) > 80: sv = sv[:77] + "..."
print(" {} = {}".format(n, sv))
except Exception as ex:
print(" {} = <unreadable: {}>".format(n, ex))
print("")
print("=== Sub-Objekt Properties (ALLE) ===")
# Erst alle Sub-Objekt-Properties autodetect (anything mit "+" im String)
sub_names = set()
for n in dir(attrs):
if n.startswith("_"): continue
try:
v = getattr(attrs, n)
if callable(v): continue
if "DisplayPipelineAttributes+" in str(v):
sub_names.add(n)
except Exception: pass
# Plus die expliziten Kandidaten
for hard in ("CurveSettings", "ObjectSettings", "ShadingSettings",
"MeshSpecificAttributes", "SubObjectDisplayMode",
"ViewSpecificAttributes"):
if hasattr(attrs, hard): sub_names.add(hard)
for sub_name in sorted(sub_names):
try:
sub = getattr(attrs, sub_name)
print(" --- {} ---".format(sub_name))
for n in sorted(dir(sub)):
if n.startswith("_"): continue
try:
v = getattr(sub, n)
if callable(v): continue
sv = str(v)
if len(sv) > 80: sv = sv[:77] + "..."
print(" {} = {}".format(n, sv))
except Exception as ex:
print(" {} = <unreadable: {}>".format(n, ex))
except Exception as ex:
print(" {} couldn't be inspected: {}".format(sub_name, ex))
print("")
print("=== ini-Export ===")
# In den Desktop schreiben damit der User die Datei einfach manuell
# oeffnen + mir den Inhalt schicken kann (in /tmp gehts manchmal verloren).
ini_path = os.path.expanduser("~/Desktop/dossier_plan_inspect.ini")
try:
ok = DisplayModeDescription.ExportToFile(dmd, ini_path)
print(" Export OK: {}{}".format(ok, ini_path))
if ok and os.path.exists(ini_path):
with open(ini_path, "r", encoding="utf-8", errors="ignore") as f:
content = f.read()
print(" ini-Inhalt ({} chars) — siehe Datei auf dem Desktop.".format(len(content)))
# Falls Rhinos Log das Print durchlaesst, hier ueberhaupt rein
print("===INI-START===")
for line in content.split("\n"):
print(line)
print("===INI-END===")
except Exception as ex:
print(" Export-Fehler:", ex)