I am trying to execute below python command block with gui dialogue box, but is is not working.
It works when I run through python file by just normal file import.
language switch_to python import Adams import os default_folder = os.getcwd() m = Adams.getCurrentModel() try: files = [f for f in os.listdir(default_folder) if f.endswith(('.x_t', '.xmt_txt'))] except FileNotFoundError: print(f"Error: Folder '{default_folder}' not found.") exit() if not files: print(f"No Parasolid files found in '{default_folder}'.") exit() for file_name in files: part_name = os.path.splitext(file_name)[0] file_path = os.path.join(default_folder, file_name) try: m.Parts.createRigidBody(name=part_name) Adams.read_parasolid_file(file_name=file_path, part_name=part_name) print(f"Successfully imported '{part_name}' from '{file_path}'.") except Exception as e: print(f"Error importing '{part_name}' from '{file_path}': {e}")