|
Software Companions XML Markup Format Description
The Software Companions XML markup format can be easily created by a third-party application or by using a text editor.
By using this format you can create your own markup files from scratch. Most of the different markup element types
available in ViewCompanion, can be created from XML.
A xml formatted markup file can be used in combination with the command line option /lxml.
You can also load it by using the "Add From File" menu command.
The default extension for a Software Companions XML Markup File is .scmx, but .xml can also be used.
File Format Specification
The file must start with the following header:
<?xml version="1.0" encoding="UTF-8"?>
<SCMarkupFormat>
Only UTF-8 encoding is currently supported.
The header and elements section must then follow. A layers section can optionally be included. A sample xml markup file is shown below:
<?xml version="1.0" encoding="UTF-8"?>
<SCMarkupFormat>
<Header>
<Unit>mm</Unit>
</Header>
<Layers>
<layer name="Markup Layer 1" color="#0000FF" enabled='1'/>
<layer name="Markup Layer Two" color="#00ff00" enabled='1'/>
</Layers>
<Elements>
<Element>
<type>Text</type>
<layer>0</layer>
<page>0</page>
<insertx>10</insertx>
<inserty>30</inserty>
<user>Peter</user>
<color>#FF0000</color>
<text>This is a text</text>
<rotation>45</rotation>
<font height='10' facename='Times New Roman'/>
</Element>
</Elements>
</SCMarkupFormat>
This xml markup file defines a single text element. The insert position is 10mm from left and 30 mm from bottom of the drawing. The markup coordinate system origin is always the lower left corner of the drawing.
The coordinates can be given in millimeters, inches or native (1016 DPI) values.
All color values are coded as red, green and blue intensities in hexadecimal notation (HTML standard - #RRGGBB).
The Layers section defines two layers.
Please see the different section descriptions below for more information.
Header Section
This section contains settings that are common for all markup elements.
The supported entries in this section are:
- Unit
- Accepted values:
| Value | Description |
| mm | Coordinates and sizes are given in millimeters. |
| inch | Coordinates and sizes are given in inches. |
| mil | Coordinates and sizes are given in 1/1000 inch. |
| native | Coordinates and sizes are given in native plotter coordinates (1016 DPI). |
Layers Section
This section contains layer definitions. Each layer definition can have three different attributes.
The first defined layer will have index 0, the next one 1, etc. The layer index is used when elements are defined.
- The description of each attribute is given below:
-
| Attribute Name | Description |
| Name | Name to use for the layer. |
| Color | Default color to use for elements placed on this layer. |
| Enabled | Enter a value different from 0 to make the layer visible. |
Sample entry:
<Layer name="Markup Layer 1" color="#0000FF" enabled='1'/>
This entry will create a layer that are named "Markup Layer 1", with default color blue and it will be visible/enabled.
Elements Section
This section contains one or more Element entries. See description of Element section below.
Element Section
This section defines a new markup element. Some of the entry keywords are common for all element types, and some are specific.
The table below lists the keywords that are common for all elements:
| Keyword | Description |
| type |
Markup element type. The following element types are supported:
Ellipse
Erase Polygonal Area
Erase Rectangular Area
Eraser
Line
Picture
Polygon
Polyline
Rectangle
Revision Cloud
Rubber Stamp
Text
|
| handle |
An unique element id.
|
| layer |
Layer index to use for the markup element.
|
| page |
Page index where the markup element will be placed. Page indexes are zero based.
|
| transparent |
If defined, the markup element will be transparent.
|
| user |
Name of the user that have created the element (optional).
|
Ellipse Markup Element
The ellipse element requires the following keywords, in addition to the common keywords:
| Keyword | Description |
| boundary |
Define boundary for the created ellipse. The boundary is defined using four attributes. These attributes are named: x1, y1, x2 and y2.
Sample boundary entry: <boundary x1='80' x2='180' y1='10' y2='110'/> |
|
| fillcolor |
Define fill color to use for the element.
|
| color |
Define outline color to use for the element.
|
| linewidth |
Define width of the outline. The width is defined using the active unit. This entry is optional. |
| linestyle |
Define line style to use for the outline. This entry is optional.
|
| fillstyle |
Define fill style to use for the element. This entry is optional.
|
Sample ellipse element xml definition:
<element>
<type>Ellipse</type>
<layer>0</layer>
<page>0</page>
<boundary x1='80' x2='180' y1='10' y2='110'/>
<user>Paul</user>
<color>#FF0000</color>
<fillcolor>#FFCCFF</fillcolor>
<fillstyle>0</fillstyle>
<linewidth>1.0</linewidth>
<transparent/>
</element>
|
The xml data to the left will create the following ellipse:
|
Erase Polygonal Area
Define an area to hide (erase) using a polygon. This feature is also known as wipeout.
The erase polygonal area element requires the following keywords, in addition to the common keywords:
| Keyword | Description |
| points |
This section contains one point entry for each point in the polygon. Each point is defined with an x and y attribute.
See the xml definition below for an example on how to describe point entries.
|
Sample erase polygonal area element xml definition:
<element>
<type>Erase Polygonal Area</type>
<layer>0</layer>
<page>0</page>
<user>Bill</user>
<points>
<point x='150' y='190'/>
<point x='150' y='290'/>
<point x='200' y='290'/>
<point x='200' y='265'/>
<point x='175' y='265'/>
<point x='175' y='215'/>
<point x='200' y='215'/>
<point x='200' y='190'/>
<point x='150' y='190'/>
</points>
</element>
|
The xml data to the left will erase the polygonal area as shown below when used for sample file compare_revA.plt:
|
|
|
|
Before xml markup is loaded.
|
After xml markup is loaded.
|
Erase Rectangular Area
Define an area to hide (erase) using a rectangle. This feature is also known as wipeout.
The erase rectangular area element requires the following keywords, in addition to the common keywords:
| Keyword | Description |
| boundary |
Define boundary for the created rectangle. The boundary is defined using four attributes. These attributes are named: x1, y1, x2 and y2.
Sample boundary entry: <boundary x1='150' x2='190' y1='230' y2='290'/>
|
Sample erase rectangular area element xml definition:
<element>
<type>Erase Rectangular Area</type>
<layer>0</layer>
<page>0</page>
<boundary x1='150' y1='190'
x2='230' y2='290'/>
</element>
|
The xml data to the left will erase the rectangular area as shown below when used for sample file compare_revA.plt:
|
|
|
|
Before xml markup is loaded.
|
After xml markup is loaded.
|
Eraser
Define a polyline that will erase/hide drawing contents. This is known as the freehand eraser in ViewCompanion.
The polyline defined will be drawn with the current background color and with the width defined by the linewidth setting.
The eraser element requires the following keywords, in addition to the common keywords:
| Keyword | Description |
| points |
This section contains one point entry for each point in the polyline. Each point is defined with an x and y attribute.
See the xml definition below for an example on how to describe point entries.
|
Sample eraser element xml definition:
<element>
<type>Eraser</type>
<layer>0</layer>
<page>0</page>
<linewidth>5.0</linewidth>
<points>
<point x='150' y='190'/>
<point x='150' y='290'/>
<point x='200' y='290'/>
<point x='200' y='265'/>
<point x='175' y='265'/>
<point x='175' y='215'/>
<point x='200' y='215'/>
<point x='200' y='190'/>
</points>
</element>
|
|
Line Markup Element
The line element requires the following keywords, in addition to the common keywords:
| Keyword | Description |
| boundary |
Define boundary for the created line. The boundary is defined using four attributes. These attributes are named: x1, y1, x2 and y2.
Sample boundary entry: <boundary x1='80' x2='180' y1='10' y2='110'/>. The line will be drawn between x1,y1 and x2,y2.
|
| color |
Define line color to use for the element.
|
| linewidth |
Define the width of the line. The width is defined using the active unit. This entry is optional. |
| linestyle |
Define line style to use for the line. This entry is optional.
|
Sample line element xml definition:
<element>
<type>Line</type>
<layer>0</layer>
<page>0</page>
<boundary x1='80' x2='180' y1='10' y2='110'/>
<user>Bill</user>
<color>#00FF00</color>
<linewidth>1.0</linewidth>
<linestyle>0</linestyle>
</element>
|
The xml data to the left will create the following line:
|
Picture Markup Element
The picture element requires the following keywords, in addition to the common keywords:
| Keyword | Description |
| boundary |
Define boundary for the created line. The boundary is defined using four attributes. These attributes are named: x1, y1, x2 and y2.
Sample boundary entry: <boundary x1='100' x2='200' y1='100' y2='200'/>. The picture will be scaled to fit the rectangle defined by x1,y1 and x2,y2.
|
| filename |
Full path to the picture file that will be added as markup. Please note that either double back slash (\\), or a single slash (/) must be used. |
Sample picture element xml definition:
<element>
<type>Picture</type>
<layer>0</layer>
<page>0</page>
<boundary x1='100' x2='200' y1='100' y2='200'/>
<filename>D:\\temp\\logo.jpg</filename>
<user>Bill</user>
</element>
|
The xml data to the left will add the following picture:
|
Polygon Markup Element
The polygon element requires the following keywords, in addition to the common keywords:
| Keyword | Description |
| points |
This section contains one point entry for each point in the polygon. Each point is defined with an x and y attribute.
See the polygon element definition below for an example on how to describe point entries.
|
| color |
Define line color to use for the element.
|
| fillcolor |
Define fill color to use for the element.
|
| color |
Define outline color to use for the element.
|
| linewidth |
Define width of the outline. The width is defined using the active unit. This entry is optional. |
| linestyle |
Define line style to use for the outline. This entry is optional.
|
| fillstyle |
Define fill style to use for the element. This entry is optional.
|
Sample polygon element xml definition:
<element>
<type>Polygon</type>
<layer>0</layer>
<page>0</page>
<user>Bill</user>
<color>#FF0000</color>
<fillcolor>#CCFFCC</fillcolor>
<linewidth>0</linewidth>
<fillstyle>1</fillstyle>
<points>
<point x='10' y='10'/>
<point x='20' y='20'/>
<point x='30' y='10'/>
<point x='20' y='0'/>
</points>
</element>
|
The xml data to the left will create the following 4-point polygon:
|
Polyline Markup Element
The polyline element requires the following keywords, in addition to the common keywords:
| Keyword | Description |
| points |
This section contains one point entry for each point in the polyline. Each point is defined with an x and y attribute.
See the polyline element definition below for an example on how to describe point entries.
|
| color |
Define line color to use for the element.
|
| fillcolor |
Define fill color to use for the element.
|
| color |
Define outline color to use for the element.
|
| linewidth |
Define width of the polyline. The width is defined using the active unit. This entry is optional. |
| linestyle |
Define line style to use for the outline. This entry is optional.
|
| fillstyle |
Define fill style to use for the element. This entry is optional.
|
Sample polyline element xml definition:
<element>
<type>Polyline</type>
<layer>0</layer>
<page>0</page>
<user>Bill</user>
<color>#FF0000</color>
<linewidth>0.5</linewidth>
<points>
<point x='10' y='10'/>
<point x='15' y='15'/>
<point x='20' y='10'/>
<point x='25' y='15'/>
</points>
</element>
|
The xml data to the left will create the following 4-point polyline:
|
Rectangle Markup Element
The rectangle element requires the following keywords, in addition to the common keywords:
| Keyword | Description |
| boundary |
Define boundary for the created rectangle. The boundary is defined using four attributes. These attributes are named: x1, y1, x2 and y2.
Sample boundary entry: <boundary x1='80' x2='180' y1='10' y2='110'/>
|
| fillcolor |
Define fill color to use for the element.
|
| color |
Define outline color to use for the element.
|
| linewidth |
Define width of the outline. The width is defined using the active unit. This entry is optional. |
| linestyle |
Define line style to use for the outline. This entry is optional.
|
| fillstyle |
Define fill style to use for the element. This entry is optional.
|
Sample rectangle element xml definition:
<element>
<type>Rectangle</type>
<layer>0</layer>
<page>0</page>
<boundary x1='10' x2='100' y1='110' y2='200'/>
<user>Ben</user>
<color>#0000FF</color>
<fillcolor>#00CCFF</fillcolor>
<fillstyle>1</fillstyle>
<linewidth>0</linewidth>
<transparent/>
</element>
|
The xml data to the left will create the following rectangle:
|
Revision Cloud Markup Element
The revision cloud element requires the following keywords, in addition to the common keywords:
| Keyword | Description |
| boundary |
Define boundary for the created revision cloud. The boundary is defined using four attributes. These attributes are named: x1, y1, x2 and y2.
Sample boundary entry: <boundary x1='80' x2='180' y1='10' y2='110'/>
|
| fillcolor |
Define fill color to use for the element.
|
| color |
Define outline color to use for the element.
|
| linewidth |
Define width of the outline. The width is defined using the active unit. This entry is optional. |
| linestyle |
Define line style to use for the outline. This entry is optional.
|
| fillstyle |
Define fill style to use for the element. This entry is optional.
|
Sample revision cloud element definition:
<element>
<type>Revision Cloud</type>
<layer>0</layer>
<page>0</page>
<boundary x1='50' x2='150' y1='210' y2='250'/>
<user>Mary</user>
<color>#FF00FF</color>
<fillstyle>0</fillstyle>
<linewidth>3</linewidth>
<transparent/>
</element>
|
The xml data to the left will create the following revision cloud:
|
Rubber Stamp Markup Element
The rubber stamp element requires the following keywords, in addition to the common keywords:
| Keyword | Description |
| boundary |
Define boundary for the created rubber stamp. The boundary is defined using four attributes. These attributes are named: x1, y1, x2 and y2.
Sample boundary entry: <boundary x1='80' x2='180' y1='10' y2='110'/>
|
| backcolor |
Define stamp background color.
|
| textcolor |
Define color to use for the stamp text.
|
| text |
Stamp text.
|
| font |
Define font to use for the stamp text. The font is defined using several different attributes,
each of them correspond to the Windows LOGFONT defintition. The following font attributes are supported:
height - Same as LOGFONT lfHeight. Please note that ViewCompanion will recalculate this value.
orientation - Same as LOGFONT lfOrientation.
weight - Same as LOGFONT lfWeight.
italic - Same as LOGFONT lfItalic.
underline - Same as LOGFONT lfUnderline.
strikeout - Same as LOGFONT lfStrikeout.
charset - Same as LOGFONT lfCharset.
outprecision - Same as LOGFONT lfOutPrecision.
clipprecision - Same as LOGFONT lfClipPrecision.
quality - Same as LOGFONT lfQuality.
pitch - Same as LOGFONT lfPitchAndFamily.
facename - Same as LOGFONT lfFaceName.
Sample font definition: <font italic='1' facename='Times New Roman'/>
|
| linewidth |
Define width of the outline. The width is defined using the active unit. This entry is optional. |
Sample rubber stamp element definition:
<element>
<type>Rubber Stamp</type>
<layer>0</layer>
<page>0</page>
<boundary x1='80' x2='180' y1='10' y2='110'/>
<user>Bob</user>
<text>Draft</text>
<textcolor>#FF0000</textcolor>
<backcolor>#FFCCCC</backcolor>
<font italic='0' facename='Times New Roman'/>
<transparent/>
</element>
|
The xml data to the left will create the following rubber stamp:
|
Text Markup Element
The text element requires the following keywords, in addition to the common keywords:
| Keyword | Description |
| insertx |
Text x insert coordinate. Coordinate is defined using the active unit. |
| inserty |
Text y insert coordinate. Coordinate is defined using the active unit. |
| rotation |
Text rotation in degrees. |
| textcolor |
Define color to use for the text. |
| text |
Text. |
| font |
Define font to use for the text. The font is defined using several different attributes,
each of them correspond to the Windows LOGFONT defintition. The following font attributes are supported:
height - Same as LOGFONT lfHeight.
width - Samer as LOGFONT lfWidth.
orientation - Same as LOGFONT lfOrientation.
weight - Same as LOGFONT lfWeight.
italic - Same as LOGFONT lfItalic.
underline - Same as LOGFONT lfUnderline.
strikeout - Same as LOGFONT lfStrikeout.
charset - Same as LOGFONT lfCharset.
outprecision - Same as LOGFONT lfOutPrecision.
clipprecision - Same as LOGFONT lfClipPrecision.
quality - Same as LOGFONT lfQuality.
pitch - Same as LOGFONT lfPitchAndFamily.
facename - Same as LOGFONT lfFaceName.
Sample font defintion: <font italic='1' facename='Times New Roman'/>
|
Sample text element defintion:
<element>
<type>Text</type>
<layer>0</layer>
<page>0</page>
<user>Bob</user>
<insertx>10</insertx>
<inserty>30</inserty>
<textcolor>#FF0000</textcolor>
<text>This is a text</text>
<rotation>45</rotation>
<font height='10' facename='Times New Roman'/>
</element>
|
The xml data to the left will create the following text element:
|
Line and Fill Style Values
Linestyle
The linestyle can be defined using one of the following values:
0 Solid line.
1 Dashed line.
2 Dotted line.
3 Dash-dot line.
4 Dash-dot-dot line.
Fillstyle
The fillstyle can have one the following values:
0 Outlined (no fill).
1 Solid fill.
2 Horizontal hatch.
3 Vertical hatch.
4 Crosshatched.
5 Diagonal hatch.
6 Diagonal cross hatching.
|