With OLE ('Object Linking and Embedding '), you can embed the output window from one Windows application into another Windows application. Use this, for example, to enhance a Microsoft Word document with Creo Elements/Direct Drafting drawings. Or add Microsoft Excel data to your Drafting drawing. Follow these two examples to learn how to use OLE with your data:
Note. OLE enhancements in Creo Elements/Direct Drafting 17.0 are summarized at the end of this article.
Note. The examples below assume you have standard installations of Microsoft Word and Excel and Creo Elements/Direct Drafting. The file types ‘MI’ and ‘DOC/DOCX’ and ‘XLS/XLSX’ need to be registered on Windows.
Example 1: A Microsoft Word document enhanced with a Creo Elements/Direct Drafting OLE
Suppose you’re creating a product manual. You can use your Creo Elements/Direct drawing to illustrate your Word document. In this example, you’ll see how a section of a Creo Elements/Direct Drafting .mi file is embedded in Word.
1. Start Microsoft Word
2. Load the Word document
3. Click ‘Insert’ → 'Object’ (Fig. 1).
4. The dialog to embed an object appears. Activate the ‘Create from File’ tab (Fig. 2)
5. ‘Browse’ to the Drafting drawing (the file must have a .mi file extension) and load it.
Note. The MI OLE object is now linked to the Word document, but the view is NOT updated. At this point, you should see a black rectangle (Fig. 3).
Type: CHANGE_VIEWPORT_COLOR WHITE
Zoom: ctrl + right Mouse button
Move: ctrl + left mouse button
A Creo Elements/Direct Drafting drawing enhanced with a Microsoft Excel table
Suppose you’d like to include a workflow to a design. In this example, we embed data from an Excel file in a Creo Elements/Direct Drafting drawing.
1. Generally, Excel spread sheets have black text on a white background (Fig. 1). Drafting has white text and geometry on a black background.
2. Change in Excel text and frame color to white and the background color to black (Fig. 2) and store.
3. Store the Excel sheet that is prepared for Creo Elements/Direct Drafting 17.0
4. Start Creo Elements/Direct Drafting 17.0
5. Load a drawing
6. From Creo Elements/Direct Drafting, click ‘Insert’ → ’Object’. The Insert Object dialog appears (Fig. 3).
a. In the ‘Inset Object’ menu, check ‘Create from File’
b. Browse to the Excel sheet
c. Click ‘OK’
7. Enter a Creo Elements/Direct Drafting internal name for the OLE, or accept the given OLE name (Fig. 4). In this case, we used the name, Excel.Sheet.12. The OLE will be listed with that name in Drafting’s OLE list.
8. Now resize and move the OLE until it suits your drawing (Figs. 5 and 6). The OLE can be resized and moved as any Drafting object.
OLE enhancements in Creo Elements/Direct Drafting 17.0
OLE handling was introduced with Creo Elements/Direct Drafting 9. But Creo Elements/Direct Drafting 17 added outstanding enhancements in OLE handling for usability, printing, and inquiries. Now:
- OLEs are attached to Drafting parts. OLEs can be handled inside the part structure.
- Drafting OLEs are compatible with Annotation.
- The following general commands can be applied to OLE; no separate commands needed anymore:
- Undo/Redo support enabled
- Modify with all its options
- Change Level
- Print to PDF and PS files enabled
- Possible to inquire OLE objects (see next slide for inquire numbers)
- The following inquire commands have been added for OLE elements:
- INQ 28 (returns Z-level for PICTURE and OLE)
- INQ 318 (returns application name)
- INQ 319 (returns class ID)
- INQ 320 (returns OLE type as „LINK“, „EMBEDDED“ or „STATIC“)
- The following inquire numbers for OLE elements have been revised:
- INQ 403 (returns OLE, if OLE is selected and not PICTURE as before)
- INQ 8 (returns 3 if OLE is shown in icon mode)