Elemente: BIM Project Browser + Properties-Satellite-Window
Zwei neue Satellite-Windows (analog Kamera/Text-Editor): 1) Projekt-Übersicht (elemente_uebersicht.py + ElementeUebersichtApp.jsx) - Tree Geschoss → Kind → Element-Instanzen - Suche + Kind-Filter-Chips - Klick = selektieren in Rhino, Shift+Klick = zoomen - Erreichbar via account_tree-Button im Elemente-Panel-Header 2) Properties-Satellite (elemente_properties.py + ElementePropertiesApp.jsx) - Eigenes Fenster mit der PropertiesView (gemeinsame Komponente) - Live-Updates: elemente._send_state forwarded zu satellite-bridge via sticky - Erreichbar via open_in_new-Icon oben rechts in der Properties-Karte - Inline-Properties im Panel bleiben — Satellite ist für mehr Platz Plus ElementeApp-Cleanup: - ElementList (alle Elemente-Liste) raus — wird jetzt von Projekt- Übersicht abgedeckt. - Properties springen bei Selektion nach oben, NeuesElement bleibt voll sichtbar darunter (kein Scrollen mehr). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,66 @@
|
||||
#! python 3
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
elemente_properties.py
|
||||
Properties-Satellite-Window. Zeigt die Property-Forms (WallProperties,
|
||||
RaumProperties, etc.) in einem eigenen groesseren Fenster — fuer Power-
|
||||
User die mehr Platz beim Editieren wollen ohne dass das Elemente-Panel
|
||||
ueberfrachtet wird. Daten kommen 1:1 vom ElementeBridge (sticky).
|
||||
"""
|
||||
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
|
||||
|
||||
|
||||
class ElementePropertiesBridge(panel_base.BaseBridge):
|
||||
def __init__(self):
|
||||
panel_base.BaseBridge.__init__(self, "elemente_properties")
|
||||
|
||||
def _send_state(self):
|
||||
# Holt sich den aktuellen State vom Haupt-ElementeBridge — der hat
|
||||
# die Element-Enumeration + Selection-Erkennung schon implementiert.
|
||||
elemente_bridge = sc.sticky.get("elemente_bridge")
|
||||
if elemente_bridge is None:
|
||||
self.send("STATE", {"elements": [], "geschosse": [], "selection": None})
|
||||
return
|
||||
try:
|
||||
elemente_bridge._send_state() # broadcast — auch wir bekommen das via sticky-Forward
|
||||
except Exception as ex:
|
||||
print("[ELEMENTE-PROPS] _send_state fail:", ex)
|
||||
|
||||
def _on_ready(self):
|
||||
self._send_state()
|
||||
|
||||
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" or t == "REQUEST_STATE":
|
||||
self._on_ready()
|
||||
elif t == "UPDATE_ELEMENT" or t == "DELETE_ELEMENT":
|
||||
# Forward to main ElementeBridge — same handler
|
||||
eb = sc.sticky.get("elemente_bridge")
|
||||
if eb is not None:
|
||||
try: eb.handle(data)
|
||||
except Exception as ex:
|
||||
print("[ELEMENTE-PROPS] forward:", ex)
|
||||
|
||||
|
||||
def open_as_window():
|
||||
"""Oeffnet die Properties-View als Satellite-Window."""
|
||||
b = ElementePropertiesBridge()
|
||||
sc.sticky["elemente_properties_bridge"] = b
|
||||
panel_base.open_satellite_window(
|
||||
"elemente_properties",
|
||||
title="Element — Eigenschaften",
|
||||
size=(480, 720),
|
||||
bridge=b)
|
||||
Reference in New Issue
Block a user