@BrianEkins
there is a py file with the manifest file, this is what is in the py file
import os
import shutil
import glob
import filecmp
import adsk.core, adsk.fusion, adsk.cam
# Global variable to hold Fusion 360 application and user interface
app = adsk.core.Application.get()
ui = app.userInterface
def find_all_fusion_thread_directories():
# Locate the Autodesk Fusion 360 web deployment directory
user_app_data = os.getenv('LOCALAPPDATA')
fusion_base_dir = os.path.join(user_app_data, 'Autodesk', 'webdeploy', 'production')
# Search for all ThreadData folders
thread_data_paths = glob.glob(fusion_base_dir + '/**/ThreadData', recursive=True)
# Return a list of all found ThreadData paths
return thread_data_paths
def add_custom_thread_profiles():
try:
# Find all Fusion 360 ThreadData directories
fusion_thread_dirs = find_all_fusion_thread_directories()
if not fusion_thread_dirs:
ui.messageBox("No Fusion 360 ThreadData directories found.")
return
# Get the path to the 'data' folder within the add-in's directory
script_dir = os.path.dirname(os.path.realpath(__file__))
data_dir = os.path.join(script_dir, 'data')
# Collect all XML files in the 'data' folder
if not os.path.exists(data_dir):
ui.messageBox("The 'data' folder was not found in the script's directory.")
return
xml_files = [f for f in os.listdir(data_dir) if f.endswith('.xml')]
if not xml_files:
ui.messageBox("No XML thread files found in the 'data' folder.")
return
# Track if any files were copied
files_copied = False
copied_files_list = []
# Copy each XML file to all ThreadData directories only if different or missing
for fusion_thread_dir in fusion_thread_dirs:
for file_name in xml_files:
source_file = os.path.join(data_dir, file_name)
destination_file = os.path.join(fusion_thread_dir, file_name)
# Check if the file already exists and is identical
if not os.path.exists(destination_file) or not filecmp.cmp(source_file, destination_file, shallow=False):
shutil.copyfile(source_file, destination_file)
files_copied = True
copied_files_list.append(destination_file)
print(f"Copied {file_name} to {fusion_thread_dir}")
# Show a message only if files were copied
if files_copied:
ui.messageBox(f"ISO Metric Thread Profiles for 3D Printing have been updated. (Arroway.ltd)")
except Exception as e:
if ui:
ui.messageBox(f"Error: {e}")
# Required Fusion 360 functions for add-in management
def run(context):
add_custom_thread_profiles()
# Automatically stop the add-in after running
stop(context)
def stop(context):
pass # No message box; add-in will stop silently after completion