机械荟萃山庄

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
热搜: 活动 交友 discuz
查看: 1353|回复: 0

SolidWorks宏命令、插件、可执行文件

[复制链接]

2万

主题

2万

帖子

17万

积分

超级版主

Rank: 8Rank: 8

积分
176590
发表于 2020-4-10 18:09:16 | 显示全部楼层 |阅读模式
宏命令
Macros are most commonly used within the SOLIDWORKS interface which means that an instance of SOLIDWORKS must be running for this code to be run. Macros are most commonly coded in VBA (Visual Basic for Application), similar to the syntax used for VB.net.

An example would be if you had a drawing file (.SLDDRW) open in SOLIDWORKS and would like to save it as a PDF, you would create a macro from the Tools > Macro > New menu and place the code found in the article SOLIDWORKS VBA Macro Code to Save Drawing as a PDF and run it through the .SOLIDWORKS interface.

A SOLIDWORKS macro is essentially a shortcut to a task performed repeatedly in SOLIDWORKS, such as adding specific items to custom properties, changing image qualities prior to closing a working document, opening default templates etc. You can also record or build a macro in SOLIDWORKS and play it back to repeat the commands — however, keep in mind that this may not always work as intended as some actions through the user interface are difficult for the recording tool to capture.

插件
Add-ins for SOLIDWORKS will be created outside of the SOLIDWORKS interface, most commonly through the Visual Studio Platform. This Add-in will typically show on the ribbon menu when SOLIDWORKS is launched. After creating the add-in and compiling it using the .net platforms, you are required to load that add-ins DLL in the SOLIDWORKS interface and enable it through Tools > Add-ins like you would do any other SOLIDWORKS add-ins including Routing, PDM, Electrical etc.

If you use SOLIDWORKS PDM, you can create a SOLIDWORKS PDM Add-in which will be added to the Administration tool to run when certain commands are executed within the Vault, similar to the SOLIDWORKS Task Add-in and Dispatch Add-in.
Add-ins can have multiple “buttons” (functions) to run different commands in one ribbon, allowing for better integration and clarity within the software

可执行文件
Executable is an application that can be written in a Visual Studio platform and run outside of SOLIDWORKS and SOLIDWORKS PDM. With the right DLL file references, it will be able to access commands within SOLIDWORKS and PDM allowing you the ability to work with altering multiple files within a folder, changing their properties and updating file references using the document manager API. For PDM user’s this is similar to how the File Version Upgrade Utility was created, it’s a PDM Executable, that runs outside of PDM and SOLIDWORKS that goes in and updates the file references using certain parameters.

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|小黑屋|手机版|Archiver|机械荟萃山庄 ( 辽ICP备16011317号-1 )

GMT+8, 2024-12-26 11:23 , Processed in 0.099598 second(s), 19 queries , Gzip On.

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表