AutoCAD Lisp 连接帮助功能以显示 Youtube 视频

AutoCAD Lisp hook up help function to show Youtube video

我在使用自定义 Youtube 视频连接 AutoCAD Lisp 中的 F1 帮助功能时遇到问题,而不是显示默认的 AutoCAD 帮助文件。我发现 this article 很有用,但它不允许我以任何方式提供 YouTube 视频。

自定义 AutoCAD 浏览器太旧,不支持 HTML5(运行 Youtube 视频需要)。对如何解决我的问题有帮助吗?

案例:如何将 F1 帮助绑定到 AutoCAD Lisp 中的自定义函数,然后在 F1 按键上激活 Youtube 剪辑。

过了一会儿,我想通了。我不得不使用 HTML/Javascript 的组合来触发默认的网络浏览器(希望它支持 HTML5),然后在那里查看 Youtube 剪辑:

口齿不清:

(setfunhelp "C:MyFunction" "C:\path\to\html\file\MyFunc_Help.html")
(defun C:MyFunction ()
  (alert "this is my function")
)

HTML:

<html>
    <body>
    <script>
    function OpenInNewTab(url, callback) {
      var acWindow = window.open("", "_self");
      acWindow.document.write("");
      setTimeout (function() {acWindow.close();},500);

      var newWindow = window.open(url, '_blank');
      newWindow.focus();
    }
    OpenInNewTab("https://youtu.be/FERNTAh5s0I");
    </script>
    </body>
</html>

此 HTML 代码在您的默认浏览器中打开一个新浏览器 window,然后在 500 毫秒后关闭 AutoCAD 默认浏览器。

希望对大家有所帮助。