#### IfcGloballyUniqueId

Natural language names

##### Semantic definitions at the type

Type definition

Holds an identifier that is unique throughout the software world. This is also known as a Globally Unique Identifier (GUID) or Universal Unique Identifier (UUID) by the Open Group. The identifier is generated using an algorithm published by the Object Management Group. The algorithm is explained at the open group website. The Microsoft Foundation Class (MFC) function "CoCreateGuid", which is an implementation of the above algorithm, has been used by many IFC implementers to create an identifier.

An identifier is a unique 128-bit number. Since this identifier is required for all IFC object instances, it is desirable to compress the identifier size to reduce overhead. Beginning in IFC R1.5.1, IFC implementers agreed to compress the identifier down to 20 characters using an algorithm developed by IAI Implementers. This algorithm maps the identifier bits onto a base 85 digit encoded from the following character set:

0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!#$%&^|*+,-./:;<=>?~`@_

An index (0-84) into this character set string determines the "value" for each character (e.g. "A" has a value of 10, "@" has a value of 83, etc.). Note that all characters are case-sensitive. In order to prevent possible problems with some parsers, implementers have agreed not to use the "/*" and "*/" character combinations in the identifier string and instead to use "\*" and "*\".

The implementation of the compression algorithm has changed in IFC R2x in order to prevent conflicts with special characters in the ISO 10303-21 exchange file and the W3C XML file (such as '<*', '*>', '<' and '>'). Using 64 characters for the base rather than 85, the resulting compressed string now needs 22 characters. The encoding of the base 64 character set is shown below:

> 1 2 3 4 5 6
> 0123456789012345678901234567890123456789012345678901234567890123
> "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_$";

The following code example in C is given as a guideline for creating the base 64 compressed strings and for mapping the previous base 85 strings to the base 64 strings. This code is provided "as-is" with no support or guarantee of suitability provided by the IAI. Use of the code example is at the sole risk of the user.

- CreateGuid_64.h
- CreateGuid_64.c

The resulting string is a fixed 22 character length string to be exchanged within the IFC exchange file structure.

> HISTORY: New type in IFC R1.5.1.

##### Formal representations

XSD Specification
`<xs:simpleType name="IfcGloballyUniqueId">
<xs:restriction base="xs:normalizedString">
<xs:minLength value="22"/>
<xs:maxLength value="22"/>
</xs:restriction>
</xs:simpleType>
<xs:element name="IfcGloballyUniqueId-wrapper" nillable="true">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="ifc:IfcGloballyUniqueId">
<xs:attributeGroup ref="ifc:instanceAttributes"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
`
EXPRESS Specification
`TYPE IfcGloballyUniqueId = STRING (22) FIXED;
END_TYPE;

EXPRESS-G diagram

`

Link to this page