diff --git a/vs-code-extension/CHANGELOG.md b/vs-code-extension/CHANGELOG.md index 227668c..df2b5d0 100644 --- a/vs-code-extension/CHANGELOG.md +++ b/vs-code-extension/CHANGELOG.md @@ -1,4 +1,7 @@ # Change Log +## 4.1.6 +Changed: + - Option 'Download CNC exporting post processor' now redirects to the Fusion post library website ## 4.1.5 Added: - Added option to use Autodesk's ESLint rules for editing postprocessors diff --git a/vs-code-extension/out/src/extension.js b/vs-code-extension/out/src/extension.js index 5198df5..65d2a8e 100644 --- a/vs-code-extension/out/src/extension.js +++ b/vs-code-extension/out/src/extension.js @@ -971,15 +971,7 @@ function checkActiveDocumentForPost() { /** Downloads the CNC exporting post processor */ function downloadCNCExtractor() { - const ncToCopy = path.join(resLocation, "export cnc file to vs code.cps"); - var uri = vscode.Uri.file(ncToCopy); - uri.path = path.join(os.userInfo().homedir.toString(), 'export cnc file to vs code.cps'); - vscode.window.showSaveDialog({ filters: { 'Autodesk Post Processor': ['cps'] }, defaultUri: uri }).then(val => { - if (val) { - fs.createReadStream(ncToCopy).pipe(fs.createWriteStream(val.path.substring(1, val.path.length))); - message("Post saved"); - } - }); + vscode.env.openExternal(vscode.Uri.parse('https://cam.autodesk.com/hsmposts?p=export_cnc_file_to_vs_code')); } /** Encrypts or decrypts the post process */ diff --git a/vs-code-extension/package.json b/vs-code-extension/package.json index 2076c89..18634db 100644 --- a/vs-code-extension/package.json +++ b/vs-code-extension/package.json @@ -2,7 +2,7 @@ "name": "hsm-post-processor", "displayName": "Autodesk Fusion Post Processor Utility", "description": "Post processor utility.", - "version": "4.1.5", + "version": "4.1.6", "icon": "res/icons/logo.png", "author": { "name": "Autodesk", diff --git a/vs-code-extension/res/export cnc file to vs code.cps b/vs-code-extension/res/export cnc file to vs code.cps deleted file mode 100644 index e1f9ca5..0000000 --- a/vs-code-extension/res/export cnc file to vs code.cps +++ /dev/null @@ -1,136 +0,0 @@ -/** - Copyright (C) 2012-2021 by Autodesk, Inc. - All rights reserved. - - Autodesk intermediate post processor configuration. - - $Revision$ - $Date$ - - FORKID {D38E0AF6-F1A7-4C6D-A0FA-C99BB29E65AE} -*/ - -description = "Export CNC file to Visual Studio Code"; -vendor = "Autodesk"; -vendorUrl = "http://www.autodesk.com"; -legal = "Copyright (C) 2012-2021 by Autodesk, Inc."; -certificationLevel = 2; -minimumRevision = 41666; - -longDescription = "Postprocessor to generate CNC files for use with the Autodesk HSM Post Processor extension for Visual Studio Code."; - -capabilities = CAPABILITY_INTERMEDIATE; - -function onSection() { - skipRemainingSection(); -} - -function onClose() { - var cncPath = getIntermediatePath(); - var fileName = FileSystem.getFilename(cncPath); - var destPath = FileSystem.getFolderPath(getOutputPath()); - - if (getPlatform() == "WIN32") { - if (!FileSystem.isFolder(FileSystem.getTemporaryFolder())) { - FileSystem.makeFolder(FileSystem.getTemporaryFolder()); - } - var path = FileSystem.getTemporaryFile("post"); - - var registryPaths = [ - "HKEY_LOCAL_MACHINE\\SOFTWARE\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{F8A2A208-72B3-4D61-95FC-8A65D340689B}_is1", - "HKEY_LOCAL_MACHINE\\SOFTWARE\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{C26E74D1-022E-4238-8B9D-1E7564A36CC9}_is1", - "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{EA457B21-F73E-494C-ACAB-524FDE069978}_is1", - "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{1287CAD5-7C8D-410D-88B9-0D1EE4A83FF2}_is1", - "HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{771FD6B0-FA20-440A-A002-3B3BAC16DC50}_is1", - "HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{D628A17A-9713-46BF-8D57-E671B46A741E}_is1" - ]; - - var exePath; - for (var i = 0; i < registryPaths.length; ++i) { - if (hasRegistryValue(registryPaths[i], "InstallLocation")) { - exePath = getRegistryString(registryPaths[i], "InstallLocation"); - if (FileSystem.isFile(exePath + "\\code.exe")) { - break; // found - } - } - } - - if (exePath) { - exePath = FileSystem.getCombinedPath(exePath, "\\bin\\code.cmd"); - } else { - error(localize("Visual Studio Code not found.")); - return; - } - - var a = "code --list-extensions --show-versions"; - execute(exePath, a + ">" + path, false, ""); - - var result = {}; - try { - var file = new TextFile(path, false, "utf-8"); - while (true) { - var line = file.readln(); - var index = line.indexOf("@"); - if (index >= 0) { - var name = line.substr(0, index); - var value = line.substr(index + 1); - result[name] = value; - } - } - } catch (e) { - // fail - } - file.close(); - - FileSystem.remove(path); - - var gotValues = false; - for (var name in result) { - gotValues = true; - break; - } - - var foundExtension = false; - var extension; - for (var name in result) { - var value = result[name]; - switch (name) { - case "Autodesk.hsm-post-processor": - extension = name + "-" + value; - foundExtension = true; - break; - } - } - if (!foundExtension) { - error(localize("Autodesk HSM Post Processor extension not found.")); - return; - } - - var userProfile = getEnvironmentVariable("USERPROFILE"); - var extensionFolder = FileSystem.getCombinedPath(userProfile, "\\.vscode\\extensions\\" + extension); - - if (FileSystem.isFile(cncPath)) { - if (!FileSystem.isFolder(extensionFolder)) { - error(localize("Autodesk HSM Post Processor extension not found.")); - return; - } - var customFolder = FileSystem.getCombinedPath(extensionFolder, "\\res\\CNC files\\Custom"); - if (!FileSystem.isFolder(customFolder)) { - FileSystem.makeFolder(customFolder); - } - FileSystem.copyFile(cncPath, FileSystem.getCombinedPath(customFolder, fileName)); - } - writeln("Success, your CNC file " + "\"" + fileName + "\"" + " is now located in " + "\"" + customFolder + "\"" + " and you can select it in VS Code."); - } else { // non windows - FileSystem.copyFile(cncPath, FileSystem.getCombinedPath(destPath, fileName)); - writeln("Success, your CNC file " + "\"" + fileName + "\"" + " is now located in " + "\"" + destPath + "\"" + "."); - writeln("You need to manually import the CNC file in VS Code by a right click into the CNC Selector panel and select 'Import CNC file...'."); - } -} - -//Dummy function for additive toopath -function onLinearExtrude() { -} - -function onCircularExtrude() { -}