Import Text on user defined layer in Expedition

Document created by joe_krolla on Oct 21, 2010
Version 1Show Document
  • View in full screen mode

Author (required): Al Layson


Platform/Format: VBScript, Form


Use case description (required)

This script (ImportTxt.efm) will import an unformatted text file (txt - although the txt extension is not required). This will create each line of text as one text draw object in Expedition on a user defined layer. All resulting text objects will be selected allowing you to execute the "Move Object" command to move all texts to a desired location. The "Move Object" command is available in Draw Mode, hence the script will check the current mode and will exit if not currently in Draw Mode, asking you to set Draw Mode and then re-execute. This is to prevent loss of selection when the mode is changed.

There can be a difference in the GUI depending on what is available from the system:

1) If on WindowsXP and the commondialog is available then you will see a browse button next to the filename entry. Else, the browse button is disabled and user must enter the filename manually.

2) If the script is able to extract the Font Names from the registry, the user will be presented with a pulldown for font selection, else the font name will need to be manually entered (just a text entry box will be presented). If the script indeed presents a pulldown of Font Names, be aware that some font names are called by names different from that in the registry and if so, those fonts may not work (accepted by Expedition). If this is the case, use a known good font then change the font using the properties dialog afterwards.

Undo is enabled.





Location of the zip file:





Copyright 2010 Mentor Graphics Corporation. All Rights Reserved. Recipients who obtain this code directly from Mentor Graphics use it solely for internal purposes to serve as example Java or Java Script plugins. This code may not be used in a commercial distribution. Recipients may duplicate the code provided that all notices are fully reproduced with and remain in the code. No part of this code may be modified, reproduced, translated, used, distributed, disclosed or provided to third parties without the prior written consent of Mentor Graphics, except as expressly authorized above. THE CODE IS MADE AVAILABLE "AS IS" WITHOUT WARRANTY OR SUPPORT OF ANY KIND. MENTOR GRAPHICS OFFERS NO EXPRESS OR IMPLIED WARRANTIES AND SPECIFICALLY DISCLAIMS ANY WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR WARRANTY OF NON-INFRINGEMENT. IN NO EVENT SHALL MENTOR GRAPHICS OR ITS LICENSORS BE LIABLE FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES (INCLUDING LOST PROFITS OR SAVINGS) WHETHER BASED ON CONTRACT, TORT OR ANY OTHER LEGAL THEORY, EVEN IF MENTOR GRAPHICS OR ITS LICENSORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.