Thursday, 11 December 2014

Making of Solid Edge Screen Capture Part 1

Solid Edge beginning ST6 provides an extremely useful video capturing facility that sits in the bottom-right corner and provides buttons for both recording a video and uploading to YouTube.

Achieving this without the Solid Edge feature is possible too, but the highlight is the convenience offered.

A similar facility for simply capturing the active model window from within Solid Edge is not available though.

The ancient and humble PrtScr i.e. Print Screen button can capture the entire SE window when maximized and any Solid Edge dialogs can be captured by using Alt+PrtScr but there is no way to grab just the model window in Solid Edge.

Making such utility would be fun and this Solid Edge Maker Faire tutorial shows you how. Other making tutorials in this series can be accessed here.

01The free Capture Screen program and the source code can be downloaded at the end of this tutorial.

This tutorial uses Visual Studio 2010, .Net 4.0.

Start a VB.Net 'Console Application' and name it SESCapture for Solid Edge Screen Capture. Make sure the check box settings are as shown below:

02

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:

05

The initial code window would have just the Module and Sub Main lines

03

Add the following Imports statements at the top:

06

Each of these will be discussed as and when referenced in the code later.

The Windows.Forms and the System.Drawing are required for Screen and the Clipboard classes.

Whereas the InteropServices and IO namespaces are available under System even in a console application, Forms and Drawing can be imported only after adding a reference explicitly.

In the Projects > Add Reference... take the Browse tab and select the System.Windows.Forms.dll and System.Drawing.dll files.

On this PC I use, the paths are:

\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\System.Windows.Forms.dll

and

\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\System.Drawing.dll

You may as well start with a Windows Forms project and remove the Form after adding a module. I haven't tried this but it should work.

continued to part 2...


Index of all Solid Edge Tips, Tutorials and Videos...


No comments:

Post a Comment