Search

Using OLE with MicroStation

Support

<< Return to Index
Subject: Using OLE with MicroStation
Product: MicroStation/J
Operating System: All
Document Number: 8172
The OLE Container
OLE objects are MicroStation element representations of data from other applications. This representation can be "linked" to or "embedded" into a MicroStation design file. The terms "linked" and "embedded" indicate where the other application's native data is stored. A "linked" OLE object is a reference to data that is not stored in a MicroStation design file. An "embedded" OLE object means that the other application's native data is stored within the design file.

When using OLE Container, MicroStation is the container application. The functionality can be found in MicroStation's Edit > Paste Special menu. Windows applications that support OLE should work with MicroStation, but only Microsoft® Word 97 and Microsoft Excel 97 have been certified with our OLE commands. The basic procedure for linking an Excel spreadsheet is:

  1. Open the Excel spreadsheet and MicroStation design file.
  2. Highlight the cells you want to link from Excel.
  3. Choose Edit > Copy.
  4. In MicroStation choose Edit > Paste Special. You will see the following dialog box.

Here is a description of the options. This list may vary based on the data format that the supplying application generates.

Metafile/Picture: Data from the supplying application will be converted into MicroStation elements. The collections of elements will be a static snapshot and will not change when the source application changes the data. This is different from a linked or embedded object that may change when the source application changes. However, "Metafile/Picture", "Linked xxx Object", and "Embedded xxx Object" are all represented using MicroStation elements that are generated from metafiles generated by the supplying application.

Text to Design File: The text from the source application will come in as ASCII text. This option will place the text using the current active text attribute settings in MicroStation. The formatting of an Excel spreadsheet's columns and rows will not be kept.

Embedded Microsoft Excel Worksheet: An embedded object becomes part of the DGN in which it is contained. Use embedding when the information in the object pertains only to the design file. For example, if you give your DGN to a client or consultant, they can open the DGN then double-click the embedded object. It will automatically start their spreadsheet software and extract the embedded data. If the design file is lost or damaged the spreadsheet data will also be lost.

Linked Microsoft Excel Worksheet: A linked object is a file that can be viewed from its container application, but actually exists in its source application. All modifications to the object need to be done in the source application. The only attribute that can be modified in MicroStation is the size of the object. To link an object to a MicroStation design file, both the source application and MicroStation must be loaded on the same system.

Link Text to Design File: Will produce a DDE link (Dynamic Data Exchange). It's similar to an OLE link except there isn't a container application. One benefit of using DDE is that the text attributes are not decided by the source application so you can use the font and size you normally use in MicroStation. This option will only link text, and if used with a spreadsheet the formatting of that spreadsheet will be lost.

Bitmap to Design File: A bitmap image of the entire area that is copied to the Windows clipboard.

Here is a description of the methods:

By Object's Size: This option will let you place an object by a scale factor. If your working units per inch is set to 1.0 an inch will measure the same as one master unit. For example the above image displays the object's natural width to be 6 inches. If the object is placed in a DGN using 1.0 for working units per inch it will measure 6 master units. This is the recommended method to place an object.

By 2 Corner Points: This option will let you place an object by 2 points. The size and scale of the objects you place will vary. In most cases you should use By Object's Size.

If you have a current link in your DGN the Links dialog box will be available.

Update Now: This option will update attached links. It only works when the Update mode is set to Manual.

Open Source: This option will launch the source application and file if it is not already open.

Change Source: If the source file is moved to another drive or folder, you need to tell MicroStation the new location. If the location changes MicroStation will scan the surrounding folders for it. It could choose a different file with the same name in its place, which might give an undesirable result.

Break Link: This option will break the link. The geometry in MicroStation will no longer change when the source application changes.

In the MicroStation Edit menu is the option Outline OLE Objects (Edit > Outline OLE Objects). If enabled, it will outline all linked objects with a thick dashed line and all embedded objects with a thick solid line.

Configuration variables
Here are some configuration variables that can be added to MicroStation that will further enhance the functionality of the OLE container.

If you receive the following error messages the font(s) you are using in the source application is not loaded in MicroStation. There are 3 ways to handle this.

 

  • Ignore the error message. MicroStation will substitute the Windows font with the current font being used in MicroStation.
  • Use the Font Installer in MicroStation to import the TrueType font you're using in the source application. The error message will stop appearing. When installing fonts for use with OLE make sure the "Character Set" is set to CP1250.
  • You can add the following configuration variable to MicroStation:
    Variable: MS_OLECNTR_FONTMAP_name of Windows font
    Replace any spaces in the font's name with underscores (for example, Times_New_Roman)

    New Value: MicroStation font name

    Example: MS_OLECNTR_FONTMAP_Times_New_Roman

    The value for this variable will be "engineering".

    Note that the text may not align properly with the other geometry.

By default all text characters copied from Excel into MicroStation using OLE will be separate text strings, making text manipulation difficult. The following variable will make all the text in each cell one text string.

Variable: MS_OLECNTR_CONFIG_UseInterCharacterSpacing
New Value: 0 for text strings, 1 for individual text characters

Note that the text may not align properly with the other geometry

Typically an object brought into MicroStation using OLE will be a cell. If it's larger than 128k (the cell size limit) it will not be a cell. In either case, the geometry will be members of a graphic group. Setting MS_OLECNTR_CONFIG_CreateObjectsAsCells to zero is useful if you plan to modify the geometry of the OLE object using MicroStation's tools. Note: This makes sense only if the OLE object is neither linked nor embedded because your changes will be discarded when the object is updated.

Variable: MS_OLECNTR_CONFIG_CreateObjectsAsCells
New Value: 0 for text and lines, 1 for cells

Quattro Pro (and possibly other software) uses filled areas for the background color of spreadsheet cells and graphs. When the objects are brought into MicroStation using OLE the filled objects will cover the text you wish to be visible. The following variables will change the objects so they are not filled. Note: You should disable background fill from within the supplying application.

Variable: MS_OLECNTR_CONFIG_AllowFilledBackgroundText
MS_OLECNTR_CONFIG_AllowFullImageFill
New Value: 0 for both variables. It will remove the fill.

Guidelines
There are some things to keep in mind when using OLE with MicroStation regarding font attributes and the physical size of data. The font that is used can be easily changed but the height and width cannot. These attributes are determined by the source application.

Regarding the physical size of data, Excel (and other Windows applications) will only copy a limited amount of data to the Windows clipboard. There is a support article on the Microsoft Web site that explains this in detail. The easiest way to find out when you reach this limitation is to:

  1. Open your Windows Clipboard Viewer (if you are using Windows 95 you may need to install it).
  2. Choose Window > Clipboard.
  3. Choose View > Picture. This will show what information is available for use with OLE (the graphics that appear are what can be linked).

Additionally, Excel will not copy horizontal complex data it thinks is outside a typical printed sheet of paper. If you have a very wide spreadsheet and it's being cutoff, reduce the size of the columns. This is not a matter of the number of columns, just the physical space. If you suspect this is happening, do the following in Excel:

  1. Highlight the spreadsheet.
  2. Hold down the Shift key and choose Edit > Copy Picture (this option is only available when holding down the Shift key).
  3. Select "As shown on screen" and "Picture" then click OK.

If you receive the message "The picture is too large and will be truncated" you have exceeded the page limit.

 

 

How useful was this page?
less
  more
Suggest new content or let us know how we can improve this content (optional):

<< E-mail this page