diff --git a/rhino/rhinopanel.py b/rhino/rhinopanel.py index f893c81..cc9b3b2 100644 --- a/rhino/rhinopanel.py +++ b/rhino/rhinopanel.py @@ -396,20 +396,30 @@ class EbenenBridge(panel_base.BaseBridge): except Exception: pass def _update_clipping(self, active_z=None): - """Clipping-Plane folgt aktivem Geschoss — nur wenn dessen hasClipping=True.""" + """Clipping-Plane folgt aktivem Geschoss — nur wenn dessen hasClipping=True. + + IMMER aus doc.Strings lesen statt das uebergebene `active_z` direkt zu + verwenden — der SET_ACTIVE-Pfad schickt ein Minimal-Payload (nur + id/name/isGeschoss/okff) ohne hasClipping/schnitthoehe. Wenn wir uns + darauf verließen, wuerde der Geschoss-Wechsel jede Clipping-Plane + loeschen weil enabled=False auswertet. Der persistierte Record in + doc.Strings hat die vollen Daten.""" doc = Rhino.RhinoDoc.ActiveDoc - if active_z is None: - z_raw = doc.Strings.GetValue("dossier_zeichnungsebenen") + # ID aus Hint oder aus dem persistierten active_id + active_id = None + if isinstance(active_z, dict): + active_id = active_z.get("id") + if not active_id: active_id = doc.Strings.GetValue("dossier_active_id") - if z_raw and active_id: - try: - z_list = json.loads(z_raw) - active_z = next((z for z in z_list if z.get("id") == active_id), None) - except Exception: - active_z = None - # Volles Dump des Active-Geschosses fuer Diagnose. Wenn hier - # hasClipping fehlt aber im UI gesetzt wurde, hat React's Dialog die - # Daten nicht weitergereicht (haeufig: WebView-Cache zeigt alte JS). + # Vollen Record aus doc.Strings holen + z_raw = doc.Strings.GetValue("dossier_zeichnungsebenen") + if z_raw and active_id: + try: + z_list = json.loads(z_raw) + active_z = next((z for z in z_list if z.get("id") == active_id), None) + except Exception: + pass + # Volles Dump des Active-Geschosses fuer Diagnose. try: print("[CLIP] active_z keys: {}".format( sorted(active_z.keys()) if active_z else None))