When several files are open in Solid Edge, switching to each for closing can be time consuming, especially with large files. Closing a file directly without having to 'switch' to it and wait for the graphics to update can be a time saver.
This Solid Edge Maker Faire tutorial shows you how to code such a utility program. Other making tutorials in this series can be accessed here.
![]() | This Solid Edge Close Multiple program and its source code can be downloaded at the end of this tutorial. |
This tutorial uses Visual Studio 2010, .Net 4.0.
Start a VB.Net 'Forms Application' and name it CloseMultiple. Make sure the check box settings are as shown below (3):
From the menu, select Project > Add Reference... and from the dialog that appears, take the COM tab. Add references to Solid Edge Framework, Solid Edge FrameworkSupport, and the Solid Edge constants libraries.
You can see these added under References in the Solution Explorer:
Create a Form as shown below:
The files are listed in a ListView control.
Change the properties of the ListView as below:
Name | lvFiles |
Anchor | Top,Bottom, Right, Left |
CheckBoxes | True |
GridLines | True |
View | Details |
Click the button with three dots or ellipsis for the Columns - Collection property. This opens the ColumnHeader Collection Editor.
Click the Add button to add two columns in the list view: FileName and Path. Change both the Name and Text properties to match as shown.
Add the following Imports statements at the top of the code window. Each of these will be discussed as and when referenced in the code later.
Inside the Form class, declare variables for the Solid Edge Application and the Documents collection as shown in the last 3 line above.
Index of all Solid Edge Tips, Tutorials and Videos...
No comments:
Post a Comment