在最近的一次Fusion 360 的大更新中,除了Generative design 有更强的支持外,然后就是把API的开发环境移动到了VScode里面了!
相比原来丑丑的Spyder,VScode还是好看了很多。

那我们就来看看如何安装VScode到Fusion吧
安装 VScode
首先要去VScode的网站上下载VScode,选择符合你电脑的版本,下载下来安装即可。
https://code.visualstudio.com/

安装VScode Extension
为了让Fusion360环境可以和VScode联通,所以还需要给VScode安装几个插件
一个是 Fusion360 Post Processor Utilitiy,这个是用于联通Fusion 360 与VScode的插件,可以直接在EXTENSIONS里面搜索到直接Install,如果没有能够下载,可以跳转到网站上手都下载。

选择ms-python的版本!
一般来说,VScode可能已经就给你把Python装好了,但是目前最新的ms-python的版本不能直接使用,需要把版本降到 2019.9.34911 之前,那么如何操作呢?


在Fusion里面编辑
这个时候应该就算是配置好了,那让我们在Fusion里面编辑看看

点击完Edit之后,VScode就会自动弹出,然后我们来跑一下示例的代码
选中TestScript 跳转到VScode,进入Debug(直接RUN是不行的,在Debug的情况下,VScode和Fusion 才是联通的)

点击DEBUG的那个小三角,就可以看到了窗口里就可以弹出了。

到这里就算是联通的Fusion 360 和 VScode了,最开始我也是因为Python版本的问题,卡了蛮久,后来去论坛提了问,才得到了解答。所以也才想分享出来,毕竟FusionAPI的中文资料很少,碰到问题还是很麻烦的。
网友评论