对于录制宏操作之后,之前的版本是可以直接另存了Vb.net 或者C# 的格式的文件的,虽然它只是VSTA的项目,但是语法基本是一样的。

刚接触SolidWorks二次开的小伙伴可能只知道swp这个原始格式。

而且Solidworks中还专门有个选项,如2018中

并且很多电脑上宏录制完成之后 ,根本就没有其它格式,只有swp.

这是为什么呢? 我们今天来看看官方的说明,打开API 帮助文件。

搜索一下VSTA这个关键字。

Prerequisite Software
Installing VSTA
Creating a .NET macro in SOLIDWORKS 2018
Editing a .NET macro created in SOLIDWORKS 2018
Upgrading a .NET macro created in SOLIDWORKS 2017 or earlier
Running a .NET DLL created in SOLIDWORKS 2017 or earlier
Prerequisite Software
Microsoft Visual Studio 2015 (Community, Professional, Premium or Enterprise version) must be installed in order to record, edit, or debug VB.NET and C# macros using VSTA (3.0) 2015 in SOLIDWORKS 2018.
Notes: If you install a version of Microsoft Visual Studio that is later than 2015, you must ensure that a runtime version of Microsoft Visual Studio 2015 is also installed.
If you do not install Microsoft Visual Studio 2015 before you install SOLIDWORKS 2018, you will not be able to record, edit, or debug VSTA 3.0 macros. You will only be able to run VSTA 3.0 DLLs.
If you install Microsoft Visual Studio 2015 after you install SOLIDWORKS 2018, you must also install the VSTA runtime to record, edit, or debug VSTA 3.0 macros.
Installing VSTA
SOLIDWORKS 2017 and earlier used VSTA 1.0 to create, edit, and run .NET macros. SOLIDWORKS 2018 supports both VSTA 1.0 and VSTA (3.0) 2015. SOLIDWORKS 2018 activates VSTA (3.0) 2015 by default on all Windows versions. If VSTA 3.0 is enabled, .NET macros created in previous releases are converted when they are edited in this release. If VSTA 3.0 is enabled, be sure to back up your VSTA 1.0 macros before editing them in SOLIDWORKS 2018. If you do not want to convert your .NET macros, you can still edit and run VSTA 1.0 macros in this release, provided you choose to install VSTA 1.0 during the SOLIDWORKS installation and then de-select Tools > Options > System Options > General > Enable VSTA VERSION 3.0.If you need to edit or run VSTA 1.0 macros on:Windows 8 or later machines:During SOLIDWORKS 2018 installation, click Change above the Products window on the Summary screen.
Expand SOLIDWORKS in the Product Selection window.
Select Visual Studio Tools for Applications (VSTA).
On the Summary screen, click Install Now.
During installation, a message box appears with "An app on your PC needs the following Windows feature: .NET Framework 3.5 (includes .NET 2.0 and 3.0)." Click Download and install this feature. If you do not select to download and install this feature, then VSTA 1.0 will not work.
Visual Studio Tools (1.0), Visual Studio Tools 2015, and other components are installed.
Windows 7 machines:During SOLIDWORKS 2018 installation, click Change above the Products window on the Summary page.
Expand SOLIDWORKS in the Product Selection window.
Visual Studio Tools for Applications (VSTA) is selected by default to install VSTA 2015 and VSTA 1.0. After installing .NET Framework 4.6.2, a system reboot occurs. When the system comes back up, Visual Studio Tools 2015 and the remaining components are installed. If VSTA is de-selected in the installer, then VSTA 1.0 is not installed.
After installing SOLIDWORKS 2018:Select Tools > Options > System Options > General > Enable VSTA VERSION 3.0 to configure VSTA (3.0) 2015. When opened, .NET macros created in previous releases are converted to VSTA 2015, and an instance of Visual Studio 2015 opens the converted .NET macro for editing. See Prerequisite Software.If you prefer to use VSTA 1.0 to edit or run VSTA 1.0 macros created in previous releases, you must first activate VSTA 1.0 by de-selecting Tools > Options > System Options > General > Enable VSTA VERSION 3.0.
Note: You  must have installed VSTA during SOLIDWORKS 2018 installation. Tools > Macro > Edit > Open > File name dropdown contains:SW VBA Macros (*.swp)
SW VSTA VB Macro (*.vbproj)
SW VSTA C# Macro (*.csproj)
SW Macros (*.swp, *.swb, *.csproj, *.vbproj)Tools > Macro > New > Save As > Save as type dropdown contains:SW VBA Macros (*.swp)
SW VSTA VB Macro (*.vbproj)
SW VSTA C# Macro (*.csproj)If you did not select to install VSTA when you installed SOLIDWORKS, then all of the SOLIDWORKS macro dialog dropdowns contain only: SW VBA Macros (*.swp)You cannot modify or repair your SOLIDWORKS installation to add VSTA. You must uninstall and re-install SOLIDWORKS, selecting to install Visual Studio Tools for Applications (VSTA) during the installation.
Creating a .NET macro in SOLIDWORKS 2018 using VSTA 3.0
Read Installing VSTA.
In SOLIDWORKS, select Tools > Macro > New.
In the Save As dialog, navigate to the directory where to save the project.
Specify File name.
In Save as type select SW VSTA VB Macro (*.vbproj) or SW VSTA C# Macro (*.csproj).
Click Save.
A new instance of Visual Studio 2015 opens. See Prerequisite Software.
Solution Explorer shows:
The solution, VstaProjects.
The project name.
My Project
References (sldworks and swconst interop assemblies added from install_dir\api\redist\)
SolidWorksMacro.vb or SolidWorksMacro.cs.
The SolidWorksMacro class is assigned a GUID attribute. If you change this attribute, the macro will not run.
When you compile the macro, the project's configuration (Debug or Release) and output directory are not read. Only a release DLL is saved in project_folder/bin.
Editing a .NET macro created in SOLIDWORKS 2018 using VSTA 3.0
Read Installing VSTA.
In SOLIDWORKS, select Tools > Macro > Edit.
In the Open dialog, navigate to the project folder.
Select SW Macros in the project type dropdown.
Select the *.vbproj or *.csproj project file.
Click Open.
A new instance of Visual Studio 2015 opens the project you selected. See Prerequisite Software.
Upgrading a .NET macro created in SOLIDWORKS 2017 or earlier
Read Installing VSTA.
If VSTA 3.0 is enabled, be sure to back up your VSTA 1.0 .NET macro files before editing them in SOLIDWORKS 2018.
In order to successfully upgrade a .NET macro, the class name, "SolidWorksMacro", and the method name, "Execute", must be preserved. If you renamed those entities in your VSTA 1.0 macro, the macro cannot be upgraded to VSTA 2015.
In SOLIDWORKS, select Tools > Macro > Edit.
In the Open dialog, navigate to the SwMacro directory of the project folder created in a previous release.
Select SW Macros in the project type dropdown.
Select the *.vbproj or *.csproj project file.
Click Open.
A new project is created in project_folder/SwMacro/upgradedmacro.
A new instance of Visual Studio 2015 opens the upgraded project. See Prerequisite Software.
When you compile the macro, the project's configuration (Debug or Release) and output directory are not read. Only a release DLL is saved in project_folder/SwMacro/upgradedmacro/bin.
The original macro is not modified or moved.
Running a .NET DLL created in SOLIDWORKS 2017 or earlier
Read Installing VSTA. If you selected to install VSTA 1.0, and de-selected Tools > Options > System Options > General > Enable VSTA VERSION 3.0, you can edit or run VSTA 1.0 macros. If you did not install VSTA 1.0, then VSTA 2015 is active by default, and you must upgrade VSTA 1.0 macros to VSTA 2015: Follow the instructions in Upgrading a .NET macro created in SOLIDWORKS 2017 or earlier.
Select Tools > Macro > Run.
Select SW VSTA Macros (*.dll) in the file type dropdown.
Navigate to project_folder\SwMacro\upgradedmacro\bin.
Select the DLL.
Click Open to run the macro. 

其实官方说了很多,其实很容易看懂的。
和安装(需要单独去选VSTA环境)以及选项都有关系。
因为我不常用这种方式,毕竟一部分操作通过宏也是录制不到的,而且用swp格式也非常方便,录好的代码自己再使用VS环境再写一次,能更好的加深印象,理解和消化掉知识点。

所以我还是建议大家不要纠结这个录制的格式,习惯就好了,花太多时间去弄这个没必要的环境,不划算。
而且直接用VS 比那个方便的多。

SolidWorks二次开发-关于录制宏保存的格式相关推荐

  1. api 二次 开发 禅道_VBA SolidWorks 二次开发 API ---从宏开始

    Macro是可以用来录制一些操作的工具,然后你可以看到具体内部执行的一些代码.通过这些代码,我们可以更快更直接的找到所需要查询的API函数.我们以最简单的做一个拉伸特征开始,看如何找到对应的API 1 ...

  2. VBA SolidWorks 二次开发 API ---从宏开始

    Macro是可以用来录制一些操作的工具,然后你可以看到具体内部执行的一些代码.通过这些代码,我们可以更快更直接的找到所需要查询的API函数.我们以最简单的做一个拉伸特征开始,看如何找到对应的API 1 ...

  3. Python SolidWorks 二次开发---SolidWorks保存文件

    Python SolidWorks 二次开发-SolidWorks保存文件 Python SolidWorks 二次开发-SolidWorks保存文件 文章目录 Python SolidWorks 二 ...

  4. SolidWorks二次开发 API-获取当前语言与重命名文件

    新的一年了,开始新的分享. 做SolidWorks二次开发的时候,难免会遇到多语言的问题. 针对不同语言的客户生成不同语言的菜单,所以我们要知道Solidworks的当前界面语言是什么. 这个就简单的 ...

  5. 基于Python的Solidworks二次开发方法

    关于python简易二次开发Solidworks的小程序 第一次动手开发了一个Solidworks的小程序,实验的功能也很简单,出来分享一下,第一次大佬们也可以指出一些问题,来帮助我改进~ 此处特别感 ...

  6. 基于Python的Solidworks二次开发小尝试(一)

    文章目录 前言 一.自我理解 二.使用步骤 1.建立 Python 与 SolidWorks 之间的关联 2.通过录制宏获取vb代码 总结 前言 第一次运用python对solidworks进行二次开 ...

  7. Solidworks二次开发系列入门1

    Solidworks二次开发系列入门1 基本介绍 基本介绍 SolidWorks二次开发其实就是使用API函数对SolidWorks设计中一些重复繁琐的工作让计算机代替完成,起到辅助设计的作用. So ...

  8. SOLIDWORKS二次开发介绍

    SOLIDWORKS二次开发其实就是使用API函数来替代SOLIDWORKS设计中一些重复繁琐的工作,起到辅助设计的作用. SOLIDWORKS的二次开发是建立在软件提供的API函数的基础上的,SOL ...

  9. Python SolidWorks 二次开发---SolidWorks另存文件为其他格式

    Python SolidWorks 二次开发-SolidWorks另存文件为其他格式 Python SolidWorks 二次开发-SolidWorks另存文件为其他格式 文章目录 Python So ...

最新文章

  1. spring中@value注解需要注意
  2. 【AOP 面向切面编程】Android Studio 使用 AspectJ 监控方法运行 ( 定义连接点注解 | 定义 Aspect 切面 | 定义切入点 | 逐个处理切入点的各个连接点 )
  3. 蛋疼的配置go opengl的记录 running gcc failed: exit status 1 in golang in windows
  4. java做台球时老是闪屏_电脑老是闪屏的原因和解决办法
  5. [PAPER-RECORD]
  6. WIN7 中配置局域网
  7. android监听方法的耗时时间,Android从网络获取北京时间以及动态的监听时间
  8. 计算机专业未来希望,中国人才最紧缺的6个大学专业,希望你不要错过。
  9. edwardcmh@cnblogs
  10. sas程序matlab,MATLAB/SAS学习笔记
  11. EDIUS 9 PRO(视频编辑软件)
  12. 五、OpenCV-python 之图像处理(Ⅲ)——傅里叶变换
  13. Stack Frame JAVA运行时数据区域之栈帧
  14. ObjectBox的探究
  15. MATLAB自定义拟合函数
  16. 【 IntelliJ IDEA 】设置主题和字体
  17. Python游戏开发工程师的起步,几款游戏开发案例
  18. Golang学习日志 ━━ gin-vue-admin实现多数据库db-list
  19. Vue http request 请求拦截器
  20. 英语电影观后感之角斗士

热门文章

  1. python万年历实验报告_Python编程——万年历
  2. 推荐8个值得推荐的神器软件和网站
  3. matplotlib中cmap_Matplotlib:imshow中cmap的功能是什么?
  4. Base64编解码工具
  5. 软件项目规划大纲知识点
  6. status_breakpoint谷歌浏览器如何解决?
  7. 2020谷歌学术指标出炉,CVPR成AI学术会议总榜第一名
  8. 服务器版本的ansys证书错误,关于ANSYS Workbench 出现证书错误的解决办法
  9. SpringCloud2020学习笔记13——SpringCloud Stream消息驱动
  10. 使用conda进行python环境管理