13a5e1eb7a
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)
166 lines
5.4 KiB
Python
166 lines
5.4 KiB
Python
#! python 3
|
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
# Copyright (C) 2026 Karim Gabriele Varano
|
|
"""
|
|
inspect_section.py
|
|
Schreibt ALLE Eigenschaften der SectionStyle der aktuellen Ebene ins Log,
|
|
ohne dass irgendein Panel-Setup gebraucht wird.
|
|
|
|
Aufruf:
|
|
_-RunPythonScript "/Users/karim/STUDIO/DOSSIER/rhino/inspect_section.py"
|
|
"""
|
|
import Rhino
|
|
|
|
|
|
def dump(label, obj):
|
|
print("--- {} ({})".format(label, type(obj).__name__ if obj is not None else "None"))
|
|
if obj is None:
|
|
return
|
|
for name in dir(obj):
|
|
if name.startswith("_"):
|
|
continue
|
|
try:
|
|
v = getattr(obj, name)
|
|
except Exception as ex:
|
|
print(" {} -> err: {}".format(name, ex))
|
|
continue
|
|
if callable(v):
|
|
continue
|
|
try:
|
|
print(" {} = {!r}".format(name, v))
|
|
except Exception:
|
|
try:
|
|
print(" {} = (unprintable)".format(name))
|
|
except Exception:
|
|
pass
|
|
|
|
|
|
doc = Rhino.RhinoDoc.ActiveDoc
|
|
layer = doc.Layers.CurrentLayer
|
|
print("============================================")
|
|
print("Aktive Ebene:")
|
|
print(" Name =", layer.Name)
|
|
try: print(" Id =", layer.Id)
|
|
except Exception: pass
|
|
|
|
print("\n--- Layer-Properties die mit 'Section' anfangen ---")
|
|
for n in dir(layer):
|
|
if n.startswith("_"):
|
|
continue
|
|
if "section" in n.lower() or "hatch" in n.lower() or "fill" in n.lower():
|
|
try:
|
|
v = getattr(layer, n)
|
|
if callable(v):
|
|
continue
|
|
print(" layer.{} = {!r}".format(n, v))
|
|
except Exception as ex:
|
|
print(" layer.{} -> err: {}".format(n, ex))
|
|
|
|
# layer.SectionStyle dumpen wenn vorhanden
|
|
try:
|
|
if hasattr(layer, "SectionStyle"):
|
|
dump("layer.SectionStyle", layer.SectionStyle)
|
|
except Exception as ex:
|
|
print(" layer.SectionStyle err:", ex)
|
|
|
|
# Via doc.SectionStyles + layer.SectionStyleId
|
|
try:
|
|
if hasattr(layer, "SectionStyleId"):
|
|
sid = layer.SectionStyleId
|
|
print("\n layer.SectionStyleId =", sid)
|
|
for tname in ("SectionStyles", "SectionAttributes"):
|
|
if hasattr(doc, tname):
|
|
tbl = getattr(doc, tname)
|
|
print(" doc.{} =".format(tname), tbl, "Count:",
|
|
getattr(tbl, "Count", "?"))
|
|
try:
|
|
ss = tbl.FindId(sid)
|
|
dump("doc.{}.FindId({})".format(tname, sid), ss)
|
|
except Exception as ex:
|
|
print(" FindId err:", ex)
|
|
except Exception as ex:
|
|
print("SectionStyleId-Zweig err:", ex)
|
|
|
|
print("\n--- Doc-Tabellen (alles was 'Section' enthaelt) ---")
|
|
for n in dir(doc):
|
|
if n.startswith("_"): continue
|
|
if "section" in n.lower():
|
|
try:
|
|
v = getattr(doc, n)
|
|
if callable(v): continue
|
|
print(" doc.{} = {!r} (count={})".format(
|
|
n, v, getattr(v, "Count", "?")))
|
|
except Exception as ex:
|
|
print(" doc.{} -> err: {}".format(n, ex))
|
|
|
|
print("\n--- Layer UserDictionary ---")
|
|
try:
|
|
ud = layer.UserDictionary
|
|
cnt = ud.Count
|
|
print(" Count:", cnt)
|
|
for key in ud.Keys:
|
|
try:
|
|
v = ud[key]
|
|
print(" [{}] = {!r} (type={})".format(key, v, type(v).__name__))
|
|
except Exception as ex:
|
|
print(" [{}] err: {}".format(key, ex))
|
|
except Exception as ex:
|
|
print(" UserDictionary err:", ex)
|
|
|
|
print("\n--- Layer UserStrings (NameValueCollection) ---")
|
|
try:
|
|
nvc = layer.GetUserStrings()
|
|
print(" Count:", nvc.Count)
|
|
for k in nvc.AllKeys:
|
|
print(" [{}] = {!r}".format(k, nvc[k]))
|
|
except Exception as ex:
|
|
print(" GetUserStrings err:", ex)
|
|
# Fallback: ueber Count + GetUserString
|
|
try:
|
|
# Manche Rhino-Versionen haben GetUserStringKeys() oder iterieren anders
|
|
if hasattr(layer, "GetUserStringKeys"):
|
|
keys = layer.GetUserStringKeys()
|
|
print(" GetUserStringKeys ->", list(keys))
|
|
except Exception as ex:
|
|
print(" GetUserStringKeys err:", ex)
|
|
|
|
print("\n--- Layer UserData (Custom .NET Blobs) ---")
|
|
try:
|
|
udl = layer.UserData
|
|
print(" Count:", udl.Count if udl else "None")
|
|
if udl:
|
|
for i in range(udl.Count):
|
|
ud_item = udl[i]
|
|
print(" UserData[{}]:".format(i))
|
|
for prop in ("Description", "Name", "Id", "DataCRC", "InstanceId"):
|
|
try:
|
|
if hasattr(ud_item, prop):
|
|
print(" {} = {!r}".format(prop, getattr(ud_item, prop)))
|
|
except Exception as ex:
|
|
print(" {} err: {}".format(prop, ex))
|
|
print(" type:", type(ud_item).__name__)
|
|
print(" full type:", type(ud_item).__module__ + "." + type(ud_item).__name__)
|
|
# Dump alle public Attrs
|
|
for a in sorted(dir(ud_item)):
|
|
if a.startswith("_"): continue
|
|
try:
|
|
v = getattr(ud_item, a)
|
|
if callable(v): continue
|
|
print(" .{} = {!r}".format(a, v))
|
|
except Exception:
|
|
pass
|
|
except Exception as ex:
|
|
print(" UserData err:", ex)
|
|
|
|
print("\n--- Layer-Properties vollstaendig (alphabetisch) ---")
|
|
for n in sorted(dir(layer)):
|
|
if n.startswith("_"): continue
|
|
try:
|
|
v = getattr(layer, n)
|
|
if callable(v): continue
|
|
print(" layer.{} = {!r}".format(n, v))
|
|
except Exception as ex:
|
|
print(" layer.{} -> err: {}".format(n, ex))
|
|
|
|
print("============================================")
|