961b3c0396
Stable working state after a long iteration session. The plugin now supports:
- Multi-Surface-Select für alle Element-Typen (Türen/Fenster/Treppen/Tragwerk)
- Wand-Z-Drag → unbound mode (UK/OK-Override, Wand vom Geschoss entkoppelt)
- Wand-Z-Drag nimmt verknüpfte Öffnungen mit (Brüstung += delta_z via Idle-Pfad)
- Öffnungs-XY-Drag snapt direktional auf Wand-Tangente
- Öffnungs-Z-Drag passt Brüstung an (Fenster sofort sync, Tür deferred)
- Wand-Delete kaskadiert Öffnungen (deferred via Idle, robust gegen _Rotate/_Move)
- Source-Cascade beim Öffnungs-Delete (deferred analog Wand-Kaskade)
- Listener-Cleanup robust gegen _reset_panels.py Reload (Refs in
_dossier_runtime_event_refs gespeichert, vor Re-Install deregistriert)
- _count_same_id_type filtert IsDeleted (verhindert Source-Duplikat-Bug bei Move)
- Frontend: Brüstungs-Slider für Tür ("Schwelle"), Flügel-Block nur bei Fenster
Plus aus früherer Phase dieser Session:
- Dossier-Launcher Auto-Load via Rhinos StartupCommands-XML
- Default-Pfad zeigt auf gebundeltes startup.py (out-of-the-box für neue User)
- Splash-Window beim Plugin-Load mit native macOS rounded corners
- Diverse Launcher-Verbesserungen (Brüstungs-Default, tauri.conf, capabilities)
Known issue: bei Multi-Select-Move mit vielen Sub-Volumen kann sporadisch
"Unable to transform" auftreten (Rhinos Move-Operation kollidiert mit Wand-
Regen). Tür-spezifischer Defer-Pfad mildert das, Fenster läuft sync.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
59 lines
1.8 KiB
Python
59 lines
1.8 KiB
Python
#! python 3
|
|
# -*- coding: utf-8 -*-
|
|
"""
|
|
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"))
|