There are some tasks in using a CAD program that are repetitive or commonly used and you think “why can’t this be simplified?”. Generally these revolve around sketching or draughting functions and these are just the sort of things that can be easily programmed using visual basic.
Solid Edge delivers a number of sample macros with each version in the Solid Edge ST7\Custom folder and includes tools for such things as spell checking and batch printing/converting of files. Each of these samples each come with an executable, along with the code for you to view, analyse and edit to your own requirements.
I was recently asked during a training course whether it was possible to update all drawing views for an individual sheet (the only options being to update a drawing view one at a time or all drawing views across all sheets). Using simple automation I was able to create a macro which works as follows:
These custom macros are written in Visual Basic (which is delivered as part of Microsoft Visual Studio). If you don’t have access to this, some commands can be written in VBA which comes as part of Excel. While not as integrated, it can be a simple way of achieving an end without having to purchase extra software.
Solid Edge is written as an object oriented application and as such, objects are built into collections. For example, a draft file will have a sheets container and within that, there is a container for drawing views. These each have properties attached to them, such as name, count, etc and commands, such as add, update, etc. By working with these collections, it is easy to build an application like the one shown above.
Contact Alan Pope at Cad Central Ltd for advice on how to do this or for more information.
7,540 total views, 1 views today