Working with a String Object on a PCB in Altium Designer

您正在阅读的是 22.0. 版本。关于最新版本,请前往 Working with a String Object on a PCB in Altium Designer 阅读 21 版本
 

Parent page: PCB Design Objects

Placed String objects
Placed String objects

Summary

A string is a primitive design object. It places text on the selected layer in a variety of display styles and formats including popular barcoding standards. It can be user-defined text or a special type of string, referred to as a special string that can be used to display board or system information or the value of user parameters on the board.

Availability

Strings are available for placement in both PCB and PCB Library Editors. Use one of the following methods to place a string:

  • Choose Place » String from the main menus.
  • Click the String button () in the drop-down on the Active Bar located at the top of the design space. (Click and hold an Active Bar button to access other related commands. Once a command has been used, it will become the topmost item on that section of the Active Bar).
  • Right-click in the design space then choose the Place » String command from the context menu.

Placement

After launching the command, the cursor will change to a cross-hair and you will enter string placement mode. A string will appear floating on the cursor:

  1. Position the cursor then click or press Enter to place a string.
  2. Continue placing further strings or right-click or press Esc to exit placement mode.

Additional actions that can be performed during placement are:

  • Press the Tab key to pause the placement and access the Text mode of the Properties panel from where its properties can be changed on the fly. Click the pause button overlay ( ) to resume placement.
  • Press the Spacebar to rotate the string counterclockwise or Shift+Spacebar for clockwise rotation. Rotation is in accordance with the value for the Rotation Step defined on the PCB Editor – General page of the Preferences dialog.
  • Press the X or Y keys to mirror the string along the X-axis or Y-axis.
  • Press the L key to flip the string to the other side of the board.
  • Press the + and - keys (on the numeric keypad) to cycle forward and backward through all visible layers in the design to change placement layer quickly.
While attributes can be modified during placement (Tab to bring up associated properties panel), keep in mind that these will become the default settings for further placement unless the Permanent option on the PCB Editor – Defaults page of the Preferences dialog is enabled. When this option is enabled, changes made will affect only the object being placed and subsequent objects placed during the same placement session.

Graphical Editing

This method of editing allows you to select a placed string object directly in the design space and change its location, rotation, orientation, and size.

When a comment object is selected, the following editing handles are available:

A selected String
A selected String

  • Click and drag B to rotate the string about its reference point A (denoted by the small x).
  • Click and drag C to resize the string's bounding box in the vertical and horizontal directions simultaneously.
  • Click and drag D to resize the string's bounding box in the vertical and horizontal directions separately.
  • Click anywhere on the string away from editing handles and drag to reposition it. While dragging, the comment can be rotated or mirrored:
    • Press the Spacebar to rotate the comment counterclockwise or Shift+Spacebar for clockwise rotation. Rotation is in accordance with the value for the Rotation Step defined on the PCB Editor – General page of the Preferences dialog.
    • Press the X or Y keys to mirror the comment along the X-axis or Y-axis.
If attempting to graphically modify an object that has its Locked property enabled, a dialog will appear asking for confirmation to proceed with the edit. If the Protect Locked Objects option is enabled on the PCB Editor – General page of the Preferences dialog and the Locked option for that design object is enabled as well, that object cannot be graphically edited. Double-click the locked object to select it then disable the Locked property in the Properties or List panel or disable the Protect Locked Objects option to graphically edit the object.

Non-Graphical Editing

The following methods of non-graphical editing are available.

Editing via the Text Dialog or Properties Panel

Properties page: String Properties

This method of editing uses the associated Text dialog and Properties panel mode to modify the properties of a String object.

The Text dialog (the first image) and the Text mode of the Properties panel (the second image) 
The Text dialog (the first image) and the Text mode of the Properties panel (the second image)

During placement, the Text mode of the Properties panel can be accessed by pressing the Tab key. Once the String is placed, all options appear.

After placement, the Text dialog can be accessed by:

  • Double-clicking on the placed String object.
  • Placing the cursor over the String object, right-clicking then choosing Properties from the context menu.

After placement, the Text mode of the Properties panel can be accessed in one of the following ways:

  • If the Properties panel is already active, select the String object.
  • After selecting the String object, select the Properties panel from the Panels button at the bottom right of the design space or select View » Panels » Properties from the main menus.
If the Double Click Runs Interactive Properties option is disabled (default) on the PCB Editor – General page of the Preferences dialog, when the primitive is double-clicked or you right-click on a selected primitive then choose Properties, the dialog will open. When the Double Click Runs Interactive Properties option is enabled, the Properties panel will open.
While the options are the same in the dialog and the panel, the order and placement of the options may differ slightly.
Press Ctrl+Q to toggle the units of measurement currently used in the dialog/panel between metric (mm) and imperial (mil). This only affects the display of measurements in the dialog/panel; it does not change the measurement unit specified for the board, which is configured in the Units setting in the Properties panel when there are no objects selected in the design space.
The String properties can be accessed prior to entering component placement mode, from the PCB Editor – Defaults page of the Preferences dialog. This allows the default properties for the String object to be changed, which will be applied when placing subsequent Strings.

Editing Multiple Objects

The Properties panel supports editing multiple objects, where the property settings that are identical in all currently selected objects may be modified. When multiples of the same object type are selected manually, via the Find Similar Objects dialog or through a Filter or List panel, a Properties panel field entry can be edited for all selected objects. If values of a property are different for objects in the selection, the appropriate field will be shown as an asterisk (*) – a new property value will be applied to all selected objects.

Editing via a List Panel

Panel pages: PCB List, PCB Filter, PCBLIB List, PCBLIB Filter

A List panel allows you to display design objects from one or more documents in tabular format, enabling quick inspection and modification of object attributes. Used in conjunction with appropriate filtering – by using the applicable Filter panel, or the Find Similar Objects dialog – it enables the display of just those objects falling under the scope of the active filter – allowing you to target and edit multiple design objects with greater accuracy and efficiency.

Special Strings

While string objects can be used to place user-defined text on the current PCB layer, it is not only user-defined text that can be placed. To assist in producing documentation, the concept of special strings is used. These act as placeholders for design, system or project information that is to be displayed on the PCB at the time of output generation.

Examples of design, system, and design parameter special strings shown as source strings (the first image) and converted (the second image). 
Examples of design, system, and design parameter special strings shown as source strings (the first image) and converted (the second image).

The special strings that are available in a PCB document come from a number of sources:

  • A default set of predefined special strings are provided for use with new PCB documents. A list of available special strings (system, design and available Project parameters) can be accessed in the Properties panel in Text mode, click the  button next to the Text editing box.
  • Custom special strings can be added by defining additional parameters at the project-level – these parameters are defined on the Parameters tab of the Project Options dialog.
  • User Parameters added to components in the Schematic domain are transferred via an ECO to become available to PCB components. If a special string that refers to a component parameter is added to a PCB footprint at the source library level, that string will be interpreted on the target mechanical layer or overlay when the PCB component is placed.

Notes about Using Special Strings

  • If a string starts with the "." character, the entire string is treated as a 'special' string.
  • To include more than one special string within a PCB string, enclose each special string within apostrophe ( ' ) characters; for example: '.Pcb_File_Name_No_Path' '.Print_Date'.
  • You can also use text, spaces and special characters between concatenated special strings, for example: FileName= '.Pcb_File_Name_No_Path' : PrintDate = '.Print_Date'.
  • Spaces and special characters can also be used within Project and Variant parameter names.
Special strings are automatically converted for on-screen display. If the string cannot be converted either the value of the typed string, or a message will be displayed. For example, if the project is not under version control and the special string .VersionControl_RevNumber is placed on the PCB, the message Not in Version Control will be displayed.

Placing a Special String

To use a special string on a PCB, place a string object then select one of the special string names from the  drop-down in the Properties panel. 

Accessing special strings for a placed string object.
Accessing special strings for a placed string object.

PCB Predefined Special Strings

The following are the predefined, system-based special strings available for use on a PCB document:

  • .Application_BuildNumber – the version of the software in which the PCB is currently loaded. When generating Gerber output, use this string to record the software build on which the design was created.
  • .Arc_Count – the number of arcs on the PCB.
  • .Comment – the comment string for a component (placed on any layer in the library editor as part of the component footprint).
  • .Component_Count – the number of components on the PCB.
  • .ComputerName – the name of the computer on which the software is installed and running.
  • .Designator – the designator string for a component (placed on any layer in the library editor as part of the component footprint).
  • .Fill_Count – the number of fills on the PCB.
  • .Hole_Count – the number of drill holes on the PCB.
  • .Item – the Item that the generated data relates to (e.g., D-810-2000). The data will be used to build that item.
  • .ItemAndRevision – the item and specific revision of that Item that the generated data relates to in the format <Item ID>-<Revision ID> (e.g., D-810-2000-01.A.1). The data will be used to build that specific revision of that particular item.
  • .ItemRevision – the specific revision of the Item that the generated data relates to (e.g., 01.A.1). The data is stored in that Item Revision within the target server.
  • .ItemRevisionBase – the Base Level portion of an Item Revision's naming scheme (e.g., 1).
  • .ItemRevisionLevel1 – the Level 1 portion of an Item Revision's naming scheme (e.g., A).
  • .ItemRevisionLevel1AndBase – the Level 1 and Base Level portions of an Item Revision's naming scheme (e.g., A.1).
  • .ItemRevisionLevel2 – the Level 2 portion of an Item Revision's naming scheme (e.g., 01).
  • .ItemRevisionLevel2AndLevel1 – the Level 2 and Level 1 portions of an Item Revision's naming scheme (e.g., 01.A).
  • .Layer_Name – the name of the layer on which the string is placed.
  • .Legend – a symbol legend for mechanical drill plots. This string is only valid when placed on the Drill Drawing layer. Note: this is a legacy feature; place a Drill Table object for more detailed drill information.
  • .ModifiedDate – the modified date stamp of the PCB; it is automatically populated. Example: 23/09/2015.
  • .ModifiedTime – the modified time stamp of the PCB; it is automatically populated.
  • .Net_Count – the total number of different nets on the PCB.
  • .Net_Names_On_Layer – the names of all nets on the specific layer. This string is only valid when placed on an internal plane layer.
  • .Pad_Count – the number of pads on the PCB.
  • .Pattern – the names of the component footprints used on the PCB.
  • .Pcb_File_Name – the path and file name of the PCB document.
  • .Pcb_File_Name_No_Path – the file name of the PCB document.
  • .PCBConfigurationName – the name of the data set from which the output has been generated as defined in the Release view (Project Releaser).
  • .Plot_File_Name – for generated Gerber output, this string identifies the file name of the Gerber plot file. For printed output, it identifies the layer depicted within the output. For ODB++ output, it identifies the name of the parent folder in which the files are stored.
  • .Poly_Count – the number of polygons on the PCB (consisting of polygon pours, internal planes and split planes).
  • .Print_Date – the date of printing/plotting.
  • .Print_Scale – the printing/plot scale factor.
  • .Print_Time – the time of printing/plotting.
  • .Printout_Name – the name of the printout.
  • .Project - project name.
  • .ProjectRev - project revision.
  • .SlotHole_Count – the number of slotted holes on the PCB.
  • .SquareHole_Count – the number of square holes on the PCB.
  • .String_Count – the number of strings on the PCB.
  • .Total_Thickness – the thickness of the board.
  • .Total_Thickness(Board Layer Stack) -the thickness of the board layer stack.
  • .Track_Count – the number of tracks on the PCB.
  • .VariantName - the variant of the design from which the output has been created.
  • .VersionControl_ProjFolderRevNumber – the current revision number of the project, which is incremented whenever a full commit of the project (i.e., including the project file) is performed. Version control must be used for this string to contain any information.
  • .VersionControl_RevNumber – the current revision number of the document. Version control must be used for this string to contain any information.
  • .Via_Count – the number of vias on the PCB.
The full list of special strings available will also include any derived from user-defined project-level parameters.

Fonts and Barcodes

The PCB Editor uses TrueType fonts for string objects. In addition, support is available for presenting text strings in Barcode format. Barcodes are commonly used to tag and identify PCBs, streamlining inventory tracking through use of automated scan-machines, for example. Choice of font is made from the Text mode of the Properties panel.

TrueType Fonts

When using TrueType fonts, TrueType and OpenType (a superset of TrueType) fonts found in the \Windows\Fonts folder will be available for use. The feature also offers full Unicode support.

Note that only detected (and uniquely named) root fonts will be available for use. For example, Arial and Arial Black will be available but Arial Bold, Arial Bold Italic, will not.

To use a TrueType font, set the Font Type (in the Properties panel) to TrueType then choose a font type from the drop-down field in the Font region. Use the B (bold) and/or I (Italic) options to add emphasis to the text as required.

Enable the Inverted option to display the text as inverted, with additional controls for the size, justification, and size of the border around the text.

Embedding TrueType Fonts

The PCB Editor – True Type Fonts page of the Preferences dialog provides options for embedding TrueType fonts when saving a design and for applying font substitution when loading a design. Embedding fonts is useful when text is required to be displayed in a font that may or may not be available on a target computer upon which the design is loaded. Font substitution enables the specification of a TrueType font to be used as a replacement when loading a design where fonts have not been embedded and where fonts may not be available on the computer upon which the design is currently loaded.

The  PCB Editor - True Type Fonts page of the Preferences dialog
The PCB Editor - True Type Fonts page of the Preferences dialog

Stroke Fonts

Three Stroke-based fonts are available – DefaultSans Serif and Serif. The Default style is a simple vector font that supports pen plotting and vector photo-plotting. The Sans Serif and Serif  fonts are more complex and will slow down vector output generation, such as Gerber.

To use a Stroke-based font, enable the Stroke font option (in the Properties panel) and choose a font type from the drop-down field in the Font region.

The Stroke-based fonts are built into the software and cannot be changed. All three fonts have the full IBM extended ASCII character set that supports English and European languages.

Barcodes

The software provides the ability to place barcode symbols directly onto a PCB on any layer, allowing barcodes to be easily imprinted on a PCB as part of the manufacturing process. To use a Barcode font, set the Font Type field in the Properties panel to BarCode then define the display options as required.

BarCode ISO Code 39 (US Dept of Defense standard) and Code 128 (global trade identification standard) are supported and the actual text string from which the barcode is derived also can be displayed by enabling the Show Text option.

When showing text, choose a TrueType font to be used then set the Full Height for the text accordingly.
Specify the height and width of the barcode using either a desired overall width or a minimum barcode element width to control sizing. Whichever method is used, be sure to use sizing that will render the barcode readable to the appropriate scanners!

By using a combination of barcode and inverted text strings along with fills, if necessary, a clear barcode area can be defined on a board with more information textually than would otherwise be afforded by just the originating barcode text.

Example of using inverted barcode and additional inverted text strings.
Example of using inverted barcode and additional inverted text strings.

If you find an issue, select the text/image and pressCtrl + Enterto send us your feedback.

软件的功能取决于您购买的Altium产品级别。您可以比较Altium Designer软件订阅的各个级别中包含的功能,以及通过Altium 365平台提供的应用程序所能实现的功能。

如果您在软件中找不到某个讨论过的功能,请联系Altium销售团队以获取更多信息。

Content