SolidWorks宏命令、插件、可执行文件
宏命令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.
页:
[1]