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)
61 lines
1.9 KiB
Python
61 lines
1.9 KiB
Python
#! python 3
|
|
# -*- coding: utf-8 -*-
|
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
# Copyright (C) 2026 Karim Gabriele Varano
|
|
"""
|
|
werkzeuge.py
|
|
WERKZEUGE-Panel: Architektur-orientierte Toolbar als React-WebView.
|
|
Feuert Rhino-Befehle via RunScript bei Button-Klick.
|
|
"""
|
|
import os
|
|
import sys
|
|
import Rhino
|
|
import scriptcontext as sc
|
|
|
|
_HERE = os.path.dirname(os.path.abspath(__file__))
|
|
if _HERE not in sys.path:
|
|
sys.path.insert(0, _HERE)
|
|
|
|
import panel_base
|
|
|
|
PANEL_GUID_STR = "6d9f5040-7e1f-4f2b-c4d5-f6071829304a"
|
|
|
|
|
|
class WerkzeugeBridge(panel_base.BaseBridge):
|
|
def __init__(self):
|
|
panel_base.BaseBridge.__init__(self, "werkzeuge")
|
|
|
|
def _on_ready(self):
|
|
# Keine initialen Daten noetig — Toolbar ist statisch
|
|
pass
|
|
|
|
def handle(self, data):
|
|
if not isinstance(data, dict): return
|
|
t = data.get("type", "")
|
|
p = data.get("payload") or {}
|
|
if not isinstance(p, dict): p = {}
|
|
if t == "READY":
|
|
self._on_ready()
|
|
elif t == "RUN":
|
|
cmd = p.get("cmd")
|
|
if cmd and isinstance(cmd, str):
|
|
# Whitelist: alles muss mit "_" beginnen (Rhino-Befehl) und
|
|
# darf keine Zeilenumbrueche oder Semikolons enthalten.
|
|
cmd = cmd.strip()
|
|
if cmd.startswith("_") and "\n" not in cmd and ";" not in cmd:
|
|
try:
|
|
Rhino.RhinoApp.RunScript(cmd, False)
|
|
print("[WERKZEUGE] {}".format(cmd))
|
|
except Exception as ex:
|
|
print("[WERKZEUGE] RunScript-Fehler:", ex)
|
|
else:
|
|
print("[WERKZEUGE] Befehl ignoriert (kein '_' Praefix oder unsicher):", cmd)
|
|
|
|
|
|
def _bridge_factory():
|
|
return WerkzeugeBridge()
|
|
|
|
|
|
panel_base.register_and_open("werkzeuge", "Werkzeuge", PANEL_GUID_STR, _bridge_factory,
|
|
icon_spec=("build", "#3a6fa8"))
|