Update Level
build and deploy Speckle functions / publish-automate-function-version (push) Has been cancelled

This commit is contained in:
NLSA
2025-03-18 10:00:23 +01:00
parent 61b632cb4b
commit 76d6c1c72a
2 changed files with 13 additions and 13 deletions
+2 -4
View File
@@ -129,20 +129,18 @@ def automate_function(
return
items = []
id_lists = []
for i in all_objects:
if hasattr(i, "category"): # Check if the object has the "category" attribute
if i.category in filter_categories: # Check if the category matches the filter list
items.append(i) # Append the whole object to the items list
id_lists.append(i.id)
else:
continue # Skip if "category" does not exist
# List of properties
list_prop = [
"category",
"properties.Level.name",
"level",
"properties.Parameters.Instance Parameters.Identity Data.Name.value",
"properties.Parameters.Instance Parameters.Dimensions.Area.value",
]
@@ -194,7 +192,7 @@ def automate_function(
automate_context.store_file_result(f"./{output_file}")
automate_context.mark_run_success("All data sent successfully! Download your file below.")
except:
automate_context.mark_run_failed("An error occurred while writing to the file. Ensure that the parameters 'Level,' 'Name,' and 'Area' exist. Additionally, verify that the area/room names are correctly typed and separated by commas.")
automate_context.mark_run_failed("An error occurred while writing to the file. Ensure that the parameters Areas or Rooms category exist. Additionally, verify that the area/room names are correctly typed and separated by commas.")
# Function to sum area for each group, ensuring missing levels return 0
+4 -2
View File
@@ -22,9 +22,11 @@ def test_function_run(test_automation_run_data: AutomationRunData, test_automati
automate_sdk = run_function(
automation_context,
automate_function,
#These are test inputs, only work when testing localy.
FunctionInputs(
file_name="TestNameABC",
inlcude_areas= True,
file_name="TestName",
inlcude_areas= False,
inlcude_rooms= True,
nua_list = "Elevator E1, Level 5 Gross, Live/Work Unit, Machine RM",
nia_list = "",