How to extract workbench project name and project directory from Mechanical scripting editor?
Here is a script that can be used in Mechanical Scripting Editor.
import wbjn import os project_files_dir = wbjn.ExecuteCommand(ExtAPI, "returnValue(GetProjectDirectory())") project_wbjn_path = wbjn.ExecuteCommand(ExtAPI, "returnValue(GetProjectFile())") project_name = os.path.relpath(project_wbjn_path, project_files_dir)