Entities are groups of data with specific formats. Most sections of the MI file contain entities. The exceptions are the Start, Table of Contents, and Setup sections.
The main purpose of an entity is to save space in the MI file.
For a good example of space saving, see Example 3 in Overview of MI. The ASSP
entity is pointed to by nine
higher
entities. If entities were not used, this information would have
to be repeated at nine different places in the file.
In some cases entities are more than just a convenience: they are necessary. A dimension between two elements is a good example. If there were no entities, how would we store a dimension? With one of the elements? With both of the elements? What happens if we delete one of the elements? With entities, all we have to do is to create a dimension entity, and point to the two element entities.
An entity can consist of the following:
All these items are discussed in the following paragraphs.
Each entity has Identification and Parameter data. Attribute and Property data are optional. The following example shows an entity having all four types of data. The entity is a Line, which occurs in the Geometry Elements section. Note that the comments in italics do not appear in an MI file.
LIN Identification: Entity Type (line) 8 Entity Sequence Number 7 Attribute: Color (white) 0 Line Type (solid) 1 Line Width Display Attribute 0 Property: Property Count First Property Pointer 1 Parameter: Pointer to line start point 2 Pointer to line end point 6 End-of-entity marker 4 |~
The entity begins with the Entity Type LIN
,
followed by the Entity Sequence Number. Entities are numbered
in ascending order of appearance in the file. In this
example, the entity is the 8th entity in the file.
The line is white, and solid. The line width (pensize) is a measure of the width of the line.
Information about display attribute is contained in entity number 0
.
The line has three properties. These properties are defined in entity
number 2
. and others in the file. (In our example, this property is a
line of associated text: LAYER: 1
.)
The start point of the line is given by coordinates contained in
entity number 6
. The end point of the line is given by
coordinates contained in entity number 4
.
Each entity is terminated by |~
.
Two listings of all the MI entities are given here. The first listing is given in alphabetic sequence. If you are studying an entity in an MI file, and you want to know which chapter of this manual it appears in, use this listing.
If you want to know which entities appear in a section of the MI file, use the second listing, "Entities Arranged by Section".
ARC | Geometry Elements (#~62 )
|
ASSE | Assembly Hierarchy (#~5 )
|
ASSP | Simple Properties (#~41 )
|
ATNS | Composite Properties (#~42 )
|
BAL | Annotation Elements (#~71 )
|
BSPL | Geometry Elements (#~62 )
|
CCIR | Geometry Elements (#~62 )
|
CENL | Associated Data Types (#~82 )
|
CHA | Geometry Elements (#~62 )
|
CIR | Geometry Elements (#~62 )
|
CLIN | Geometry Elements (#~62 )
|
COC | Composite Geometry (#~63 )
|
DAF | Simple Properties (#~41 )
|
DANG | Composite Annotation (#~72 )
|
DARC | Composite Annotation (#~72 )
|
DCHMF | Composite Annotation (#~72 )
|
DCHN | Composite Annotation (#~72 )
|
DCOR | Composite Annotation (#~72 )
|
DDA | Simple Properties (#~41 )
|
DDAL | Composite Annotation (#~72 )
|
DDAS | Composite Annotation (#~72 )
|
DDIA | Composite Annotation (#~72 )
|
DDLS | Composite Annotation (#~72 )
|
DLA | Simple Properties (#~41 )
|
DRAD | Composite Annotation (#~72 )
|
DSGL | Composite Annotation (#~72 )
|
DSGS | Composite Annotation (#~72 )
|
DTA | Simple Properties (#~41 )
|
DTAN | Dimension Tangency (#~72 )
|
DTF | Simple Properties (#~41 )
|
DTV | Composite Properties (#~42 )
|
DZP | Setup (#~3 )
|
FIL | Geometry Elements (#~62 )
|
HAPP | Simple Properties (#~41 )
|
HAT | Annotation Elements (#~71 )
|
LED | Annotation Elements (#~71 )
|
LIN | Geometry Elements (#~62 )
|
LTP | Simple Properties (#~41 )
|
P | Geometry Points (#~61 )
|
PFA | Faces (#~81 )
|
PLN | Geometry Elements (#~62 )
|
PMA | Geometry Elements (#~62 )
|
PRP | Annotation Elements (#~71 )
|
PSTAT | Simple Properties (#~41 )
|
PXMAP | Other Data (#~31 )
|
RTL | Associated Data Types (#~82 )
|
SPL | Geometry Elements (#~62 )
|
SYML | Associated Data Types (#~82 )
|
TEX | Composite Annotation (#~72 )
|
The following paragraphs show the elements that exist in each MI file section.
DZP
ASSP
, DAF
, DDA
, DLA
, DTA
, DTF
, HAPP
, LTP
, PSTAT
ATNS
, DTV
ASSE
P
ARC
, BSPL
, CCIR
, CHA
, CIR
, CLIN
, FIL
, LIN
, PLN
, PMA
, SPL
COC
BAL
, HAT
, LED
, PRP
DANG
, DARC
, DCHMF
, DCHN
, DCOR
, DDAL
, DDAS
, DDIA
, DDLS
, DRAD
, DSGL
, DSGS
, DTAN
, TEX
PFA
CENL
, RTL
, SYML
PXMAP
AZ
and digits 09
. The
first character must be a letter. For example, the name P
is
used for a Point entity, and LIN
is used for a Line entity.
The first entity in the MI file can have any number, with the
lowest possible number being 1
. Each entity must have a
higher sequence number than the previous entity.
Example 7 in Overview of MI shows that, for shared parts, groups of entity
numbers
are missing in the MI file. With shared parts having the same
geometry, there is really only one part. The other parts are
virtual parts. For these virtual parts, gaps appear in the MI
file exactly equal to the size of the real part. The next visible
entity in the file is numbered as if the virtual parts actually
did appear in the file.
The entity sequence number is pointed to by
entities that
occur later in the file. Entity sequence numbers cannot have a
value of 0
, because this value is reserved for null
pointers. Sometimes the format of an entity requires the
existence of a pointer when there is no need to point at
anything. In this case, a null pointer is used, with a value of
0
.
The main purpose of having different sections in an MI file is to allow pointer references that follow these rules:
These rules allow the file to be loaded in a single pass, because there are no unresolved pointer references.
This part of the entity defines color, line type, line width, and display information. These values apply to entities such as straight lines, arcs, circles, construction lines, and annotation elements. The attributes determine how an element will appear on the screen, or how it will be plotted on paper.
An entity can have a pointer to a lower order entity, and both of these entities can might contain different attributes. The attributes within the lowest entities take precedence. For example, a composite curve can have references to lines or arcs. The attributes of the lines or arcs take precedence over the attributes of the composite curve.
If an entity definition contains attribute data, it must appear in a given syntax and order. The number of attributes may vary from one MI revision to another, and is specified in the Setup section of the MI file.
Some entities do not contain attributes. For example, a point has no attributes because it has no color, line type, line width, or display information. But a line drawn between two points has attributes.
Details of color, line type, line width, and display information are given in the next paragraphs.
If the integer is in the range 07
, the color is
selected from the following table:
Code | Color |
---|---|
0 | black |
1 | red |
2 | green |
3 | yellow |
4 | blue |
5 | magenta |
6 | cyan |
7 | white |
If the integer is outside the range 07
, the color is
based on the intensities of the red, green, and blue components
(RGB). This gives a wide variety of colors. The intensities of
the three components are varied within the range
01023
. A value of 0
means no intensity and
1023
means full intensity.
The MI RGB color code is calculated from the formula:
<eqn> color code = 65 + R + 1024G + 1024\sp {2}B <\eqn>
where R, G, and B are the red, green and blue
intensities in the integer range 01023
.
The line type values will produce the following approximate patterns on the graphic display, or when the lines are drawn by a plotter.
The display information is used by ME10. This value is set by a display flag. The line is either hidden or visible. The hidden flag is set by ME10 only. It should not be set by the user.
Some entities do not have a property data area.
If the entity has a property data area, the first entry is an integer of the type (n+). This integer is known as the Property Count. This gives the quantity of property pointers to follow. If no properties are required, the property count will be zero.
Note that entities in the Properties section do not contain pointers to other entities. They contain the required property information in their parameter data areas. This property information can be accessed by pointers from the property data areas of other entities.
Let's take the example of a line containing associated text. The
property data area of the Line entity (LIN
) contains a
pointer to an Associated Text Property entity (ASSP
). The
Associated Text Property entity contains the required text in
its parameter data area.
DLA
). Near the end of the Parameter Data, you
will see the line:
Gap between Dimension Line and End of Text Box.
We show this in initial upper case letters because it is our suggested name for the data item being described. In our experience, MI files are difficult to talk about, especially over the telephone where it may be impossible for the two people to look at the same MI file.
You can say, "I'm having a problem with a DLA
in Section
42. The gap between dimension line and end of text box doesn't
look right". Without names for the data items, it might take
a long time to identify the line you want to discuss.
It is usually only the first occurrence of such a term that is capitalized. Subsequent occurrences are in normal text.
A variety of constants are used within the MI files, representing integers, real numbers, strings and pointers. All constants are in the form of ASCII text.
An integer number must comply with the following rules:
Nmin = - 2(i-1) | |
Nmax = 2(i-1) - 1 |
and the value of i is specified in the Setup
section of the MI file. i is referred to as the Power
for Largest Integer, with a default of
32
.
The allowable range of an integer will also depend on the circumstances in which it is used. In this documentation, the following synonyms are used to represent value ranges.
Synonym | Value range | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
n | [Nmin!!Nmax] as defined
above
n+ | [0!!Nmax]
| n- | [Nmin-1]
| [I!!K] | where I and K represent the specified
limits of a subrange, so that
| | Nmin <= I < K <= Nmax
| | For example, [14] represents the
values 1, 2, 3 and 4.
| [I,K] | where I and K are defined above, and K =
(I + 1). For example, | [1,2] represents the values 1
and
2 .
|
A value of plus zero is a valid integer constant.
The use of the above synonyms does not necessarily mean
that all the values within the range are allowed. Where
necessary, further details of the allowable range will
be given in the text where the item is described, or in
the section on General Entity Format. For example, n+
is used for an Entity Sequence Number, although a value
of Here are some examples of real constants:
Both the E-notation and L-notation for exponents can be used in
MI. However, ME10 only uses E-notation.
In this documentation, the synonym String constants can be from 0 to 255 characters in
length, each character corresponding to an 8-bit binary word.
The standard used by MI is the Character Set
Processing Standard Rev. A (JAN 20 1983). This includes
the ASCII standard character set in the range
[0127] conforming to ISO 2022 specification, and
an additional set of values in the range [128255].
The character set is divided into two sections, a lower
section in the range [0127] and an upper section
in the range [128255]. Each section uses the first
7 bits of an 8-bit word, and the upper section is
obtained by setting the 8th bit.
The first 32 characters of each section [031] and
[128159], and the last character [127] and [255],
are reserved for control and data communication
purposes, and cannot be used to form visible text or
graphics. All the remaining characters can form visible
text.
For example, literal strings are used when an entity
type is being defined in the identification data
section of an entity description. In the case of the
line entity, the string literal In this documentation, the synonym Different systems produce text in different ways, depending
on the text fonts available. In ME10, it is possible to
select a primary or secondary font.
The ASCII Shift Out character (decimal 14) is used to
select the secondary font. The ASCII Shift In character
(decimal 15) is used to switch back from the secondary
font to the primary font. ME10 always selects
From MI version 2.0 onwards, these character-set switching codes
may occur in the text string of a Text Block entity (refer to
the entry for The drawing is stored in the current MI version (2.80).
Special characters are used to switch from 8-bit
character codes, such as ASCII, to 16-bit codes such as
Kanji Japanese characters.
The code to switch to 16-bit codes is:
The code to switch back to 8-bit codes is:
The default character codes used in MI are normally
8-bit ASCII.
The value of a pointer must always be smaller than the
Entity Sequence Number of the entity in which it
resides. This is because integer pointers can only point
backwards to entities which have been defined earlier
in the file.
One string pointer points forwards in the file: an
assembly entity ( The items within an entity are defined according to a
specific format, and sometimes the format will require
the existence of a pointer when there is no need to
point to anything. In this case, a Delimiters are character strings which are used as
markers within an MI file to separate the sections and
entities within the model.
The following characters are used to form delimiters,
although they can also be used within text strings for
other purposes, such as annotation and associated text.
where For example, There is no delimiter to mark the end of a section.
Each section ends where the next section begins, except
for the last section in the file, which ends with the End of MI
Data delimiter.
The marker Each parent part within a parts structure applies a
3x3 transformation matrix to each of its subparts to
determine how the geometry within the subpart is to be
displayed.
If the subpart has become shared by using the These images of the geometry can be displayed in
different locations, and can be stretched, rotated, and
distorted in a variety of ways, but there is only one
set of original geometry.
The images are produced from a series of transformation
matrices that exist within the If the subpart is not shared, or if the geometry in a
shared subpart has not been modified, there will be
only one matrix which displays the geometry in its
original form.
The transformation matrix is as follows:
If the matrix refers to an unshared part or the
unmodified first instance of a shared part, it will be
an identity matrix. All the diagonal elements will be 1
and the others will be 0 as follows:
The third row (0 0 1) is not used by ME10,
but is available for systems which perform
non-linear transformations.
The linear transformation is performed on each point in
the geometry by multiplying the first two rows by the
vector (x y 1) to get the required image point,
represented by the vector (x' y' 1). The
matrix multiplication is as follows:
This represents the set of linear equations:
Further details of transformation matrices are given in
the Appendixes.
As an example, let's derive the set of equations for the virtual
circle in Example 7 in Overview of MI.
The matrix is:
The equations are:
Each part has a unique name and a separate part
definition. Part names are discussed in chapter 9, "Part Name".
The part definition consists of a number of sections, as follows:
Not all these sections are present, and not all sections contain
entities.
Look at the
example for a completely blank screen (Example 1, chapter 1). The
part definition consists only of
sections Each part definition has a corresponding Assembly entity
( Dimension entities can reference more than one part.
This means that it is possible for a dimension entity
to point to geometry elements and points which are in
two separate part definitions.
Let's say we have an assembly consisting of a top part containing
subparts called
ME10 can create shared parts. It is possible to create a
dimension between a geometry element in the original part and a
geometry element in the copied instance. The copied instance is
represented in MI as a To find the entity number in a real part that
corresponds to an entity in a virtual part, refer
to the virtual offset parameter (attribute 1) in the
Example 7 in Overview of MI discusses dimensions between shared
parts, and shows how to use virtual pointers.
ME10 supports multiple drawing scales on one drawing.
This lets you place small and large parts on the same drawing.
The scale associated with a part can be seen in the parts tree.
To change the drawing scale:
A typical parts tree looks like the following:
The Text Block entity ( ISO character sets (International Standards Organization):
Non-ISO character sets:
0
is not allowed.
Real Numbers
Real numbers (floating point constants) may contain
fractional components to the right of a decimal point.
Valid formats are:
A floating-point constant must comply with the
following rules:
264.091
0.0
-0.58
+4.21
1.36E01
12.93E1
-13.09L-2
123.409L-4
0.1E-3
1.0E+4
145.98887645L-5
1
String Constants
String Representation
On any given system, strings will be represented within
memory in a manner which is appropriate for the
operating system and programming language.
Literal Strings
Literal strings (keywords) are character strings which
have a specific meaning in MI files.
LIN
specifies the
entity type.
LIN
, appears
in the entity descriptions.
Primary and Secondary Fonts
hp_symbols
as a default secondary font. The
table for this font is shown below:
TEX
in Composite Annotation Section (#~72)).
Codes for Drawing Symbols
The following three symbols are supported when a version
1.2 MI file is loaded by ME10:
8-Bit and 16-Bit Character Codes
ESC$@
(ASCII Characters 27,36,64)
ESC(@
(ASCII Characters 27,40,64)
Pointer Constants
Pointers are integer constants of the type n+ described
earlier, and appear within an entity to provide a
reference to another entity which has already been
defined earlier in the MI file. The value of the
pointer will be equal to the sequence number of
the entity that it points to. In the sections that describe entities,
PTR is used as the synonym for a pointer.
ASSE
) points forwards to a Part Name, which starts
the part definition.
0
. Entity Sequence Numbers
begin with a value of 1
, and a value of 0
will never be
used as this is reserved for null pointers.
Delimiters
#
ASCII character 35
|
ASCII character 124
~
ASCII character 126
MI Model Section Delimiter
The following characters are used to mark the beginning
of a section of the model:
#~N
#~1
indicates the start of section 1.
End-of-Entity Delimiter
This indicates the end of an entity and will be
followed by the name of the next entity, or the
delimiter for the start of a new section, or an end of
file delimiter. The end-of-entity delimiter is:
|~
End-of-MI-Data Delimiter
This indicates to a translator that there is no more
MI data.
The end-of-MI-data delimiter is:
##~~
End of File
The marker which represents the end of a file depends on the
operating system that produces the data. The end-of-file
marker will be written by the filing system when it has finished writing
data and the file needs to be closed.
##~~
at the end of the MI data
is not the same as the end of file marker. There may be
additional data in the file which has nothing to do with MI.
Transformation Matrices
ASSE
entity for the
[ 1 0 0
0 1 0
0 0 1]
[1 0 30
0 1 0
0 0 1]
Therefore:
Since the real circle has coordinates (0,0), the virtual circle
has coordinates (30,0).
Part Name and Part Definition
#~6
)
#~61
)
#~62
)
#~63
)
#~71
)
#~72
)
#~81
)
#~82
)
#~6, #~62
, #~71
, and
#~72
. Other sections are present only if they contain
entities.
ASSE
). The ASSE
contains the part name as a parameter.
This name is a pointer that associates the ASSE
to a part.
Dimensioning between Different Parts
SCREW1
and SCREW2
. We have a dimension between SCREW1
and SCREW2
. The dimension entity exists in the parent part
(Top). The geometry elements and points exist in the
part definitions for SCREW1
and SCREW2
. The dimension
entity in the parent part points to these geometry elements and
points.
Dimensioning between Shared Parts
ASSE
of the parent part. Then
subtract the virtual
offset from the entity number being pointed to by the dimension
entity.
The result is a pointer to the corresponding entity in
the original part definition.
Part Scaling
[*] Top [~1] [2:1]
SUBPART [~2] [2:1]
where [2:1]
is the scale factor.
Text Fonts
TEX
) in the Composite Annotation
section
(#~72
) contains a Text Font Index. The values of the
text font index correspond to the character sets given
in the following lists.
2 ISO IRV (international )
4 ISO UNITED KINGDOM
6 USASCII (valid for US, equals
ISO 646, see GKS 7.0)
10 ISO SWEDISH BASIC SET
11 ISO SWEDISH FOR NAMES
13 KATAKANA
14 JISASCII
15 ISO ITALIAN
16 ISO PORTUGUESE
17 ISO SPANISH
21 ISO GERMAN
25 ISO FRENCH
60 ISO NORWAY v1
61 ISO NORWAY v2
256 HP ROMAN EXTENSIONS
513 ROMAN8 (ROMAN8 is default for HP 8-bit characters)
514 KATAKANA8
265 HP BRITISH
266 HP GERMAN
267 HP SPANISH
268 HP 7-bit MATH SET
269 MARKERS (partial)
524 HP 8-bit MATH SET