From 373814cc2571edc33d513dc841f9e4515e747fae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn?= Date: Thu, 10 Apr 2025 09:35:22 +0200 Subject: [PATCH] feat: propert next-gen check --- main.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/main.py b/main.py index 9936d83..d1fc67e 100644 --- a/main.py +++ b/main.py @@ -484,6 +484,14 @@ def automate_function( automate_context.mark_run_failed("Model must be from Revit") return + # Validate Next-Gen + if not _validate_next_gen(model_root): + automate_context.mark_run_failed( + "Revit model must be sent using the v3 connector (or adapt the " + "automation for v2)." + ) + return + # Run analysis - convert Speckle model to dict for processing results = analyzer.analyze_model(model_root) @@ -594,6 +602,13 @@ def _validate_revit_source(commit_root: Any) -> bool: return source_app.startswith("revit") +def _validate_next_gen(model_root: Any) -> bool: + """Validate that the model was sent using the v3 connector""" + if not getattr(model_root, "version", None) == 3: + return False + return True + + def _process_automation_results( automate_context: AutomationContext, results: dict ) -> None: