From time to time, you may want to use the SansGUI environment with other software applications in a cooperative manner. This section describes a few features supported by SansGUI in the Windows environment.
Data in Grid Views can be copied into a text buffer and pasted into other applications that accept pasting from the text buffer. The buffer SansGUI uses is in text with tab delimited format. It does not support copying and pasting elements other than plain text.
To copy data from a SansGUI Grid View to other applications, using Microsoft Excel as an example, do:
In a SansGUI Grid View, select a range of cells by clicking on the cell in a corner of the range and drag the mouse until the selected range (highlighted) covers the desired area. It does not matter whether the cells are protected or not.
Select Edit>Copy from the pull-down menu or press Ctrl+C key combination. The contents of the selected range are copied to the buffer.
Open a spreadsheet from Excel, select a cell to be the upper-left corner as the target for the data to be pasted to.
Select Edit>Paste from the pull-down menu of Excel or press Ctrl+V in Excel. The data in the selected range are copied and displayed in Excel.
To copy data from other applications to a SansGUI Grid View, do:
In an Excel spreadsheet, select a range of cells by clicking on the cell in a corner of the range and drag the mouse until the selected range (highlighted) covers the desired area.
Select Edit>Copy from the pull-down menu or press Ctrl+C key combination. The contents of the selected range are copied to the buffer.
In SansGUI, open the Grid View or the Properties dialog to which the data will be transferred.
Select the upper-left cell of the target to which the data will be pasted. All the target cells should not be protected. They should all be editable with normal background color.
Select Edit>Paste from the pull-down menu of SansGUI or press Ctrl+V in SansGUI. The data in the selected range are copied and displayed in SansGUI. Please note, again, that only text data and numbers are supported.
The data plots can be exported to a file with either Windows metafile (WMF), bitmap (BMP), or JPEG (JPG) format. The file can then be imported to any applications that support these formats. See the Plotting Data section earlier for more details on using the Export dialog to save a plot in a file.
You may want to put a section of an assembly or the entire assembly in a Canvas View in your technical report, slideshow or other publications. SansGUI supports three means to do it: 1) Exporting Enhanced Metafiles: if you only need a static picture, in vector form, of the current Canvas View, 2) Exporting Image Files: if you need to capture the raster image of the current Canvas View, or 3) Using OLE Objects: if you would like to resize, zoom, scroll, and crop the picture in the other application.
If you only need a static picture of the current Canvas View to be incorporated in a document with another application, you can export the Canvas View to the Windows Clipboard (in memory) or to an external file in the Windows Enhanced Metafile (EMF) format. Once exported, you can insert it into any document with any Windows program that supports EMF. An example is to include a picture of a the Canvas View in a Microsoft Word document:
To use the Clipboard: Right click on any empty portion of the Canvas View and select Export Enhanced Metafile>To Clipboard from the context menu. Open the document in Word and select Edit>Paste Special... from the pull-down menu. From the Paste Special dialog, select Paste As: Picture (Enhanced Metafile).
To save it to an EMF file: Right click on any empty portion of the Canvas View and select Export Enhanced Metafile>To File... from the context menu. An Export EMF File dialog will be displayed to let you enter the file name. Once the file is saved, you can incorporate it by selecting Insert>Picture>From Files... from the pull-down menu of other Windows applications, such as Word.
You can also export the current Canvas View to bitmap (.BMP) or JPEG (.JPG) image files for publication purposes. To do it, select Bitmap... or JPEG... submenu item from Export Image File in the context menu.
SansGUI Canvas View is an OLE server that supports object embedding. Here we uses Microsoft Word as a container application to demonstrate how the Canvas View contents can be incorporated in a Word document.
Open a Word document where the Canvas View is to be placed.
Select Insert>Object... from the pull-down menu.
An Object dialog will be displayed. Select Create from File tab. Do not use the Create New tab because SansGUI do not allow users to create a new Project Model from inside other applications.
Use the Browse... button to open a Browse dialog.
Locate the Project Model of your choice. The Project Model should have a .sgp file extension with a red SansGUI icon. It should contain the assembly you would like to display in the Word document.
Click on the OK button to start the SansGUI OLE server. It will display the TOP assembly of the Project Model in the document.
When the SansGUI OLE server is inactive, You can drag the resizing knobs to define the rectangular area for the figure in your report.
Double click on the figure to activate the SansGUI OLE server. The menu bar and tool bar are replaced with SansGUI menus and buttons showing supported functions. This is a subset of the regular Canvas View operations in the SansGUI environment. The major difference is that you cannot create new elements, parts or links, in the OLE server.
You can navigate to the subassembly of choice, scroll the viewing area to the desirable canvas area, change zoom factors, turn on or off the labels of parts, ports and links, and show link value mode within the SansGUI OLE server. Because SansGUI has its own zoom control, the correct figure relative to the document is shown only when the document in the container program (Word) is set to 100%.
Click on the outside of the figure to deactivate the OLE server. You can add a border or a figure caption to the Canvas View as you would with other figures.
Save the document as necessary.
Because SansGUI has a highly accessible application programming interface and an easy-to-learn data object format, you are encouraged to write data filters to import data from and export data to other applications. The user overriding routines is the mechanism to doing such tasks. Please consult Chapter 6 Overriding Simulator Routines for details.
SansGUI Modeling and Simulation Environment Version 1.2
Copyright © 2000-2003 ProtoDesign, Inc. All rights reserved.