- 热门文章:
- · 有关于web播放器的列表播放问题
- · Microsoft User Interface Process Application Block 研究(3)
- · ASP.NET中使用IFRAME建立类Modal窗口
- · 挤压造型Extrusion的节点说明和应用实例
- · .net 里面 protected private 的变量也可以访问
- · 怎样得到一个系统盘的全名,不是字符,是全名,如:本地磁盘(C:)?
- · ASP.NET中新的代码编译功能(三)
- · ASP.NET中新的代码编译功能(二)
- · ASP.NET中新的代码编译功能(一)
- · asp.net里,一个小的自定义错误显示
- · ASP.NET编程中的十大技巧
- · 在ASP.NET中面向对象的编程思想
solidworks二次开发-01-录制一个宏
第一步:
我们需要自己录制一个宏,然后看看程序产生了什么代码。当初学习excel时候就是这么干的。只是,solidworks要复杂一些,直接录制的宏不能使用,需要做一些调整。在没有经验的时候我们最好按照下面的建议来做。
Edit or Debug SolidWorks Macro
Edit or debug SolidWorks macros using Microsoft VBA. 使用Microsoft VBA编辑或调试宏
To edit or debug a SolidWorks macro:
Click Edit Macro on the Macro toolbar, or click Tools, Macro, Edit.
NOTES: 注意:
To automatically edit a macro after recording it, click Tools, Options, Systems Options. On the General tab, select Automatically edit macro after recording and click OK. This setting is persistent across SolidWorks sessions.
此选项Automatically edit macro after recording 顾名思义是在记录宏完毕后自动打开编辑界面。
If you recently edited the macro, you can select it from the menu when you click Tools, Macro. This menu lists the last nine macros that you edited.
已经编辑了宏,菜单中会有最近的9个宏程序列表供选择。
In the dialog box, select a macro file (.swp) and click Open. 选择一个宏swp文件
NOTE: You can also edit .swb files, which are older-style SolidWorks macro files. When you run or edit a .swb file, it is automatically converted to a .swp file. 旧的宏文件后缀为swb,你也可以打开swb,那么会自动保存为swp。
Edit or debug the macro. If it is a new macro, be sure to:如果是新的宏
Delete extra lines of code: 删除一些多余的代码:
The following variables are declared automatically in a SolidWorks macro. Delete any variables not used in the macro. 这些对象的声明是自动产生的,可以将没用的删除 Dim swApp As Object
Dim Part As Object
Dim boolstatus As Boolean
Dim longstatus As Long, longwarnings As Long
Dim FeatureData As Object
Dim Feature As Object
Dim Component As Object
Delete all lines of code that change the view. 删除切换试图的代码
译者注:像这样的 Part.ActiveView().RotateAboutCenter 0.0662574, 0.0346621 无情的删掉吧
Delete all ModelDocExtension::SelectByID2 calls appearing immediately before ModelDoc2::ClearSelection2 calls. However, do not delete ModelDocExtension::SelectByID2 calls appearing immediately after ModelDoc2::ClearSelection2 calls.
Delete all ModelDoc2::ClearSelection2 calls appearing immediately before ModelDocExtension::SelectByID2.
下一篇:有关于web播放器的列表播放问题 >>
相关文章:
- · 有史以来最牛B的.NET程序集加密方法?
- · 在ASP.NET中实现多文件上传
- · (论坛答疑点滴)怎么给Table动态添加控件并且得到控件的值?
- · (论坛答疑点滴)有的时候DataGrid取值取不到?
- · (论坛答疑点滴)联合主键的情况怎么在DataGrid中利用DataKeys定位记录?
- · (论坛答疑点滴)__doPostBack()无效?
- · ASP.net生成文字图片
- · 自定义类(ASP.NET_VB)
- · 小技术(ASP.NET)
- · ASP.NET控制EXCEL,完全结束进程
- · ASP.NET导出数据到Excel
- · Asp.net中Treeview终极解决方案!
- · 实现一个Asp.net自定义Back控件
- · 在asp.net中长内容自动分页的实现
- · asp.net利用多线程执行长时间的任务,客户端显示出任务的执行进度的示例(二)
- · asp.net利用多线程执行长时间的任务,客户端显示出任务的执行进度的示例(一)
- · 在ASP.NET中使用Global.asax文件
- · 解决ASP.NET上传文件大小限制
- · ASP.NET如何在窗体和窗体之间传送数据
- · 令你心动的Asp.net 开发中的MessageBox控件
- · asp.net三种重定向方法的总结
- · asp.net datagrid实现多层表头
- · 一个在ASP.NET中打印的问题
- · 使用ASP.NET Web服务代理的URL行为属性
- · [ASP.NET 教程] 三. Web Forms编程模型
- · ASP.NET立即上手教程 10
- · ASP.NET如何在窗体和窗体之间传送数据
- · ASP.NET中取代ASP的RS(Remote Scripting)技术的Framework
- · [ASP.NET 教程] 三. Web Forms编程模型
- · [ASP.NET 教程] 二. Web Forms
- · [ASP.NET 教程] 一. Web基础
- · ASP.NET立即上手教程 6
- · ASP.NET立即上手教程 5
- · ASP.NET身份模拟
- · 选择ASP.NET代码编写策略
- · ASP.NET文件上传程序的源代码
- · ASP.NET HTTP运行时组成详解
- · ASP.NET Whidbey中实现Provider
