Block Commands With the SOLIDWORKS API
CADSharp is pleased to present a new free tool called Command Blocker that blocks specific commands from running in SOLIDWORKS. Optionally, you can also run a macro in lieu of the default behavior, effectively overriding the command with your own custom functionality. This tool might be used by both users and CAD admins to prevent intentionally or accidentally using certain commands:
<> Custom property dialog
<> Addin dialog
<> Copy to Adobe Illustrator
<> Edit title block
As demonstrated in the video above, this is made possible by listening for the values of commands and then entering them in a settings dialog. This means that any command in SOLIDWORKS can be blocked — use with caution!
Download
Download the Command Blocker installer here.
How It Works
The secret sauce to this addin isn’t a secret for anyone who has taken one of CADSharp’s Advanced Program Development Using .NET training course. If you haven’t taken that class, I’ll still let you in on the secret: CommandOpenPreNotify event. By listening for this event, you can cancel the default the behavior and replace it with your own. You can see a open source example of such a listener here. The class containing the event listener is shown below:
The Next Level
If you can envision this tool being useful for your organization in some modified form then please reach out to us to discuss your needs. For example, if this were to be used by a CAD administrator then additional features might include:
1. Preventing users from accessing the Settings dialog
2. Allowing the Settings dialog to import blocked commands from a list kept on a server.
Reach out to us if you’re ready to take Command Blocker to the next level. Until then, thanks for checking out this tool and don’t forget to sign up for our newsletter below so you can learn about more products like this.
Download 3DExperience World Presentations
3DExperience World, formerly known as SOLIDWORKS World, has come and gone. We exhibited at booth 118 and had a fantastic time meeting hundreds of you from around the world. Keith Rice, our Technical Director, presented three times on SOLIDWORKS API topics. You can download the files for the presentations below:
<> Macros vs Addins vs Stand-Alones – [files][video]
<> SOLIDWORKS API for Total Beginners – [files][video]
<> Write A SOLIDWORKS Addin From Scratch – [files]
If you missed us and want to chat, please reach out to us.
See you next year in Nashville!
If you want to stay up with more great content, be sure to join our newsletter.
New PDM Product: Convert DWG Task
Overview
CADSharp is partnering with EhCanadian and is pleased to present one their flagship products, “Convert DWG Task”. Formerly called, “Convert With DraftSight”, Convert DWG Task is a SOLIDWORKS PDM task add-in that converts DWG files to PDF and DXF. This program comes with its own built-in PDF generator but also supports DraftSight and AutoCAD scripting.
SOLIDWORKS includes a DWG to PDF add-in using DraftSight but its functionality is quite limited compared to Convert DWG Task, as you can see in the table below.
Features Comparison | DRAFTSIGHT | OUR ADDIN |
Output file in or out of vault type | ||
Variables in the filename | ||
Secondary output paths | ||
Secondary output paths can be relative | ||
Duplicate file handling | ||
Create reference from the destination file | ||
Custom menu command | ||
Use DraftSight for conversion | ||
Use AutoCAD or AutoCAD LT for conversion | ||
Includes built-in PDF generator | ||
VB.NET scripting | ||
C# scripting | ||
Page setup by default, layout, block, file name, etc | ||
Export all or specific sheets | ||
Export sheets based on file name or sheet name | ||
Export sheets to one or seperate PDFs | ||
Ignore model layout when exporting all | ||
Combine all PDFs from the task into one file | ||
Full API for scripting | ||
Watermark PDF on export with image or text | ||
Apply password protection to PDFs | ||
Separate email notifications with PDF attachments | ||
Email notification supports SSL | ||
Full logging |
Requirements
- SolidWorks EPDM/PDM Professional.
- DraftSight or AutoCAD must be installed on the computer running the task if you’re using scripting.
- .NET 4.5 is required, so as of version 201, this add-in will not run on EPDM 2013 and earlier.
Pricing
999 USD sign-up fee, followed by 150 USD per year
Please visit EhCanadian for more details.
Want to keep up with new CADSharp product offerings like Convert DWG Task? Sign up for our newsletter.