Creo View Installation and Configuration Guide > Creating Annotation Templates
Creating Annotation Templates
This appendix describes how to create an Annotation Template XML document.
About Annotation Templates
An Annotation Template is a set of annotation properties and values that can be applied during an edit. Annotation templates make it easy to apply a standard annotation style across a design.
Use a text editor to create and edit annotation templates. Once imported, the annotation templates will then be available for use when editing annotations in Creo View.
Annotation templates can be used to define the following properties:
Text content of a label
Expanded text option of a label
Font size of a label
Color of any annotation
Background color for a label or any shape
Line width of a leader line or freehand
Transparency of any shape
Line style of a leader line, freehand, or polygon
Lock-on-zoom property of a note
Shape of a label
About the Annotation Template XML Document
The element <annotationtemplates> can contain a number of different templates.
The file may also contain a name attribute. Use the name attribute to distinguish templates from different files that have the same name.
The element <annotationtemplate> contains <template> tags. Each <template> tag defines a single annotation template.
The <template> tag contains the following information:
An attribute name which defines the annotation template name
A list of <property> tags that define template properties in the template:
type
—Defines the type of property, for example line style or transparency.
value—Sets the value of the property
appliesto—Applies the template to certain annotation types
<type> Element
The <type> element defines type of property. Define the type of property by setting the <values> for one or more of the following:
Property Type
Values
Description
text
text
Text content for a note without attributes.
textexpanded
true, false
Expanded Text option
fontsize
real value
Font size in points
shape
circle, square, rectangle, hexagon, triangleup, triangledown, roundedrectangle
Shape of the note.
color
hexadecimal color value
backgroundcolor
hexadecimal color value
linewidth
any integer
The line widths selectable interactively corresponds to 1, 3, 5
linestyle
solid, dotdash, dotdotdash
One of the literal values shown, corresponding to the line styles available when editing interactively in Creo View.
fillstyle
none, transparent, opaque
One of the literal values shown, corresponding to the transparency values available when editing interactively in Creo View.
lockonzoom
true, false
<appliesto> Attribute
The attribute <appliesto> defines which types of annotation the property should be applied to. For example, use this attribute to define a different color for a note and a leader line separately. The value of the <appliesto> attribute is a comma-separated list of one or more of the following values:
all
note
leaderline
freehand
rectangle
ellipse
polygon— Surface polygon in 3D and a 2D polygon
Annotation Template XML Document Example
Below is an example of an Annotation Template file. The file contains three individual templates: Critical Surface Polygon, Needs Review Note and Blue Ellipse.
<annotationtemplates name="examples">
<template name="CriticalSurfacePolygon">
<property appliesto="note" value="CriticalSurface" type="text"/>
<property appliesto="note,polygon,leaderline" value="ff0000" type="color"/>
<property appliesto="polygon,leaderline" value="dotdash" type="linestyle"/>
<property appliesto="polygon" value="opaque" type="fillstyle"/>
<property appliesto="note" value="a0a0a0" type="backgroundcolor"/>
</template>
<template name="NeedsReviewNote">
<property appliesto="note" type="text">
<textsegment value="Component" type="text"/>
<textsegment value="_PV_SystemProperties.Component Name.Value" type="attribute"/>
<textsegment value="needs review" type="text"/>
</property>
<property appliesto="note" value="ff0000" type="color"/>
<property appliesto="leaderline" value="00000" type="color"/>
<property appliesto="note" value="8" type="fontsize"/>
<property appliesto="leaderline" value="3" type="linewidth"/>
<property appliesto="note" value="roundedrectangle" type="shape"/>
<property appliesto="note" value="true" type="textexpanded"/>
</template>
<template name="BlueEllipse">
<property appliesto="ellipse" value="0000ff" type="color"/>
<property appliesto="ellipse" value="opaque" type="fillstyle"/>
</template>
</annotationtemplates>