Text Form

The Text Editor form is called from the various Draw - Text tools and the Entity Inspector - Text tab - Text Editor button. It allows you to create new text entities, modify existing ones or alter their formatting.

Text Editor

Command window

This is the area where you can type the text that will appear in the text entity. It is also the area where special items, such as System text, are automatically added.

Preview window

This window displays the text entity as it will appear in the drawing, taking into account the formatting and expanding special items such as System text.

Text Style

Choose the required text style from the pulldown list, which will contain all of the styles that are defined in the Design Options - Text Styles for the current project. This will cause the associated fields, such as Font, Height and Width, to be automatically filled in with default values. If you then choose to override one of these fields the Text Style field will be cleared, to show that the settings no longer match.

Font

You can override the default font by choosing one of the other installed fonts from the pulldown list.

Height

Override the default text character height if required.

Width

Override the default text character width if required.

Text formatting

You can format the text string using the Bold, Italics, Underscore or Justification buttons.

System

Use this button to add system text. The pulldown list will be enabled containing all of the available system text items. Examples of these are Block Area (Name), Block Extents (Name), Date, Palette Area (Palette). Select the required item and the associated text will be added to the Command window. Where appropriate you should then replace the general term within parentheses with the required name.

For example:

 Block Area (Name) [BlockArea("CLB")]
 Block Extends (Name) [BlockExtents("CLB")]
 Date [Date]
 Palette Area (Palette) [PaletteArea("Cut")]

 

All of the system text items are described in some detail here.

Database

Use this button to add text from a database table. The first pulldown contains all the available database tables, such as CUSTOMER, DRAWINGS, LAYERS etc. and the second pulldown is a list of all the fields for the chosen table. Select the desired table and field. The appropriate text will then be added to the Command window, such as [DRAWINGS.D_NAME].

If you are adding a text entity within a Report Group block then the associated Data Connector will also appear in the list of database tables. This usage is described in the Data Text Entities section.

Selecting this button will give a slightly different edit bar. It will look something like this:-

Pretty Print

Switch this option to replace the field names in the pulldown list with readable names (prompts), as defined in the database structure.

Automation

Use this button to choose an Automation operation, such as a script of plug-in, to be associated with the text entity. This will enable the Automation Filename button . Press this button and choose the required file containing the automation operation. For example: [VBScript("Scripts\DisplayRuleLengths.vbs")]

Alternatively, you can enter some embedded script code, such as the following:

[Script("<VBScript>
Dim length
Dim recurse
length = 0
recurse = true

'this function is defined in the project options
length = GetPaletteLengthsOfGeometricEntities( ActiveLayer.RootBlock, recurse )

result = "Total palette lengths = " & length
")]

 

This might give a text string that looks like this:

Total palette lengths = 600

The edit bar for Automation looks something like this:-

Variable

Use this button to add the text from a drawing variable. The pull-down list will contain all of the variables associated with the current drawing. If it has been created from a standard then all the standard variables will be available.

For example:

FLUTE[Variable("FLUTE")]
F_GLANG [Variable("F_GLANG")]
GL [Variable("GL")] 
Material Type[Variable("MaterialType")]

Picture Fields

It is possible to include background pictures within a text entity. These text entities will be of particular use within Border Plots.

You can control the position of the image within the text entity using the Align and Vertical align properties on the Entity Inspector. The aspect ratio of the image is always maintained and always fills the bounding box.

Angled (rotated) images are not supported, but you can mirror the image and the Orientation is respected.

You can simply create a BLOB picture text entity by entering a database column directly, so

[CUSTOMER.CS_PICT] or [USERS.U_PICT]

will create a text entity containing an image. Updating the column (via DBW or script) and Recalculating Text Entities will update the text entities to match.

There are also two new System Text commands that can be used to create BLOB picture text entities.

  • ImageFile(filename)
  • ImageDocument(docorseriesid)

You can also pass parameters to these commands that will be evaluated before being used. These parameters can be database columns, inline script or a script file. The result returned from the script will be used to determine the picture to display.

Use ImageFile() for loading images from a file path, database column containing a path, or file path generated by a script. The path can be relative to the graphics repository.

[ImageFile("d:\image.jpg")]

A file path from a database column

[ImageFile("[USERS.U_PATH]")]

A file path from an inline piece of script

[ImageFile("[Script("<VBScript>Result = "d:\image.jpg"")]")]

Use ImageDocument() for loading images from a document by docid (specific version) or seriesid (latest version)

[ImageDocument("e95336d4-1cc1-42e7-804f-0d76321df806")]

A docid or seriesid from a database column

[ImageDocument("[USERS.U_DOCID]")]

A docid or seriesid from an inline piece of script

[ImageDocument("[Script("<VBScript>Result = "1610854b-4630-4962-b432-06437641c9e6"")]")]

Format Button

If you have entered a special item, such as System text, Database text or a Variable, and it is of a type that can be formatted, then placing the cursor within the name will enable the format button. Types that can be formatted include Date, Time and Numeric fields. Clicking this button displays the appropriate format form, such as Date Format, Time Format or Numeric Format enabling you to format the output of that particular value.

Report Drawing Areas

This pulldown will contain any Report drawing areas inserted in the current drawing. These are used in conjunction with other special items. For example, if you added a Layer Area system variable followed by the Report drawing area Step 1, the Command window would contain [Step 1@LayerArea]. When a Report Drawing is then created from this drawing the layer associated with that Report drawing area will be identified and its area calculated for use in this text entity.

Style

Pressing this button displays the Text Settings form from where you can further configure the display of this text entity.

Position

Pressing this button displays the Text Position form from where you can further define the text justification.

Right-click Context Menu

If you right-click within the Command window it displays a menu with the following options:

  • Format - this has the same effect as the Format button
  • Show Preview - use this option to toggle the display of the Preview window
  • Cut - remove the selected text to the clipboard
  • Copy - add the selected text to the clipboard without deleting it
  • Paste - add the clipboard text into the Command window at the current cursor position
  • Select all - select everything in the Command window
  • Open... - this option allows you to identify a text file, the contents of which will be copied into the Command window, replacing the existing text
  • Save As... - this option allows you to save all of the text currently in the Command window to a file

Alternatively, if you right-click within the tool bar area you will be given the option to lock the positions of the individual tool bars.

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.

You may like to read -