Information Sharing with OLE
Object Linking and Embedding (OLE) is a Microsoft Windows feature that allows you to copy or move information from one application to another while you retain the ability to edit the information in the original application. Basically, OLE combines data from different applications into one document. For example, you can create an AutoCAD® Architecture drawing that contains all or part of a Microsoft Excel spreadsheet.
OLE is a great way to use information from one application in another application, which can be useful for presentations, etc. To use OLE, you need both source and destination applications that support OLE. Information from one document into another document can be inserted by either linking or embedding the information. Both linked and embedded OLE objects can be edited from within the destination application. However, linking and embedding store information differently so it is important to ensure that you are using the correct option for the situation. The relationship between embedding and linking is similar to that between inserting a block and creating an external reference. An embedded OLE object is a copy of information from another document.
When you embed objects, there is no link to the source document and any changes made to the source document are not reflected in destination documents. Embed objects if you want to be able to use the application that created them for editing, but you do not want the OLE object to be updated when you edit information in the source document. A linked object is a reference to information in another document. Link objects when you want to use the same information in more than one document. Then, if you change the original information, you need to update only the links in order to update the document containing the OLE objects. You can also set links to be updated automatically. When you link a drawing, you need to maintain access to the source application and the linked document. If you rename or move either of them, you may need to reestablish the link.
Let’s look further into using OLE objects with AutoCAD Architecture. We will use Microsoft Excel as an example.
Importing OLE Objects
You can use one of the following methods to insert information from Excel as an OLE object:
- Cut or copy information from an existing Excel file and then paste it into the ACA drawing.
- Import an existing Excel file.
- Open Excel from within the ACA drawing by double-clicking on it and create the information that you want to use.
When the Excel information is inserted into your ACA drawing, you will need to specify an insertion point. By default, the OLE object is displayed with a frame that is not plotted. OLE objects are opaque and they will plot as opaque. This means that they hide objects in back of them. OLE objects are supportive of draw order. The display of OLE objects can be controlled in one of two ways:
- Set the OLEHIDE system variable to either display or suppress the display of all OLE objects within paper space, model space, or both.
- Freeze or turn off a layer to suppress the display of OLE objects on that layer.
When OLE objects with text are printed, the text size is approximated by the text size in the source application, Excel. It is important to note that OLE objects in ACA drawings are not displayed or plotted in external references or block references.
Embedding OLE Objects
An embedded OLE object is simply a copy of information from another document. For example, a copy of an Excel spreadsheet in AutoCAD Architecture. When you embed objects, any changes made to the source document are not reflected in destination documents because there is no link to the source document. You should embed objects only if you want to be able to use the application that created them for editing, but you do not want the OLE object to be updated when you edit information in the source document.
To embed an OLE object in a drawing, open the document you wish to embed, select, right-click, and copy the information. Next open your ACA drawing, right-click, and paste the information.
Another way to do this is to open AutoCAD Architecture, go to the Insert tab on the ribbon, Data panel, OLE Object (see Figure 1). This will bring up the Insert Object dialog box. Next select Create New. Under Object Type, select an application and click OK (see Figure 2), which will open Excel (or whichever application you choose). Now create the information you wish to insert and save the document. In Excel’s File menu, select Exit and Return. Close Excel and the object is now embedded in the AutoCAD Architecture drawing.
If needed, you can adjust the text size. To do this, select the OLE object, right-click, select OLE, and then select Text Size. This opens the OLE Text Size dialog box. Now you can select a font, point size, and text height. When finished, click OK.
Figure 1: OLE Object Tool
Figure 2: Create New
Linking OLE Objects
A linked OLE object is simply a reference to information that is located in another document. Link objects when you want to use the same information in more than one document. If you change the original information, you only need to update the links in order to update the document that contains the OLE objects. Links can be set to update automatically. It is important to note that when you link a drawing, you need to maintain access to both the source application and the linked document. If you rename or move either of them, you may need to reestablish the link.
To link a file as an OLE object, go to the Insert tab of the ribbon in AutoCAD Architecture, Data panel, OLE Object. This will bring up the Insert Object dialog box. Select Create From File (see Figure 3). Next browse and find the file you wish to use. Click Link and then select OK. Now you will need to select where you wish the OLE object to appear.
To link part of a file as an OLE object in a drawing, begin by opening ACA and Excel. Select the information in Excel you want to link and copy it to the Clipboard. In ACA, click the Home tab on the ribbon, Clipboard panel, Paste drop-down and then Paste Special. In the Paste Special dialog box, click Paste Link. Paste Link pastes the contents of the Clipboard into the current drawing and also creates a link to the file in the source application. If you click Paste, the Clipboard contents are embedded instead of linked so it is important to select Paste Special. In the “As” box, select the data format you want to use and click OK.
Figure 3: Create from File
Exporting OLE Objects
You can link or embed a view of an AutoCAD Architecture drawing within another application that supports OLE, such as Excel. The COPYLINK command copies the view in the current ACA viewport to the Clipboard and you can then paste the view into the destination document. If you paste an unnamed view into a document, it is assigned a view name such as OLE1. Then, if you exit the drawing you will be prompted to save your changes to the newly named view. In order to establish the link and to save the view name, OLE1, you must save the drawing.
You can select objects and embed them in documents created by other applications. Embedding will place a copy of the selected objects within the destination document. If you use AutoCAD Architecture to edit the OLE object from within the destination document, the object is not updated in the original drawing.
To embed objects in another document, begin by opening AutoCAD Architecture and selecting the objects that you wish to embed, right-click, and select Copy. The selected objects are now copied to the Clipboard. Open Excel and open a new or existing document. Paste the clipboard contents onto the spreadsheet, following the instructions for embedding the Clipboard contents given by Excel.
To link a view to another document, begin by opening AutoCAD Architecture and save the drawing that you want to link, so that it has a drawing name. If multiple viewports are displayed, you will need to select a viewport. Next, enter COPYLINK at the command prompt. Then open a new or existing document in Excel. Paste the clipboard contents into the document, following Excel’s procedures for inserting linked data (see Figure 4). The inserted OLE object is displayed in the document and can be edited from AutoCAD Architecture through Excel.
Figure 4: Copylink drawing in Excel
Editing OLE Objects
Linked or embedded OLE objects can be edited in a drawing by double-clicking the object to open the source application. You can use any selection method to select OLE objects and then you can use most editing commands, the Properties palette, or grips to make changes. When grips are used to change the size of an OLE object, the shape of the object does not change as long as the aspect ratio is locked in the Properties palette. If you have resized an OLE object and wish to restore it to its original size, select the OLE object, right-click and select OLE Reset. It is important to note that the following editing commands are not available for OLE objects: BREAK, CHAMFER, FILLET, and LENGTHEN.
Before looking at how to edit OLE objects, it is important to understand the difference between editing a linked object versus an embedded object. The document that contains a linked drawing stores the drawing's file location. You can edit a linked drawing either from the destination application or in the source program. The program must be loaded or accessible on the system along with the document you are editing. An ACA drawing that is embedded within a document can be edited only from within the destination application. You will need to double-click the OLE object to start the program. Editing the original drawing in the program has no effect on documents in which that drawing is embedded.
To edit a linked ACA drawing from within the destination application, begin by opening the document that contains the linked drawing (for example, a Microsoft Excel file). Double-click the linked drawing and the drawing will open. You can also select the OLE object, right-click and select AutoCAD Drawing Object, and then Edit (see Figure 5). Next modify the drawing as necessary and click File menu and select Save when done. To return to Excel, click the File menu and hit Exit. The drawing is now changed in all documents that have links to it.
To edit a linked drawing in the source application, begin by starting the program and opening the linked drawing. Make modifications to the drawing and view as necessary. Save the changes when finished. Update the link in the destination document if necessary. The drawing is changed in all documents that have links to it.
To edit embedded objects, begin by opening the Excel document that contains the embedded AutoCAD Architecture objects. Double-click the embedded objects to start the ACA program and display the objects and modify them as necessary. Save changes to the embedded objects by clicking the File menu and selecting Update. Now return to the destination application by clicking the File menu and selecting Exit.
To control the display of OLE objects in AutoCAD Architecture, enter the command OLEHIDE. Now enter one of the following values:
0 − Displays OLE objects in both paper space and model space.
1 − Displays OLE objects in paper space only.
2 − Displays OLE objects in model space only.
3 − Does not display OLE objects.
You can also control the display of the OLE frame within a drawing. To do this, enter OLEFRAME at the command prompt. Then enter one of the following values:
0 – Frame is not displayed and is not plotted.
1 – Frame is displayed and is plotted.
2 – Frame is displayed, but is not plotted.
Figure 5: Edit OLE object
Controlling Plot Quality
When a raster plotter is used, OLE objects are treated as raster objects. Since large, high-resolution, color-rich rasters can be expensive to plot, the OLEQUALITY system variable can be set to control how each OLE object is plotted. The default setting is Automatically Select and it assigns a plot-quality level based on the type of object. The higher the plot-quality setting, the more time and memory are used to plot.
The Plotter Configuration Editor can also be used to adjust OLE plot quality. The Graphics option displays a Raster Graphics dialog box with a slider that controls OLE plot quality. It is important to note that nested OLE objects may cause problems. For example, an OLE object that is not in the current view plane is not plotted, but the frame is plotted based on the setting of the OLEFRAME system variable.
To set the plot quality for OLE objects, begin by clicking the Tools menu and selecting Options. In the Options dialog box, select the Plot and Publish tab and then in the OLE Plot Quality list, select one of the following settings (see Figure 6):
- Monochrome – For text spreadsheets
- Low Graphics – For color text and pie charts
- High Graphics – For photographs
- Automatically Select – Plot-quality setting assigned based on the type of file
Click Apply to continue setting options or click OK to close the dialog box if you are finished.
Figure 6: OLE plot quality