You are here: HomeSupportArchiCAD

Updated Library Object Globally Unique Identifier (GUID)

Library Object Globally Unique Identifier (GUID)

Written by Ransom Ratcliff and László Nagy

Introduction:
With the growing complexity of object libraries, a method of tracking library parts and their revised versions was developed for ArchiCAD 8. In short, an internally coded 72-character number, in combination with the object name, or object file name, identifies each object. The 72-character number is called the GUID and it helps ArchiCAD track the iterations of an object, as it is revised or improved.

The GUID:
The GUID consists of two parts, each 36 characters long. The first 36 characters represent the "Main ID" and the last 36 characters represent the "Revision ID".

  • The Main ID is created when the library part is saved for the first time. It is also modified if the library part is resaved using the "Save as" command.
  • The Revision ID is also created when the library part is saved for the first time but it is modified if the library part is resaved using the "Save" command.

Library Part Identification:
When placing an object in ArchiCAD it refers the GUID before considering the name. When loading a library, ArchiCAD uses the following hierarchical criteria for matching loaded library parts to objects already placed into the project:

  1. It tries to get an exact mach of both parts of the GUID
  2. Failing that, it tries to match the first part of the GUID, which is the Main ID
  3. If a match cannot be found for the Main ID, then it tries to match by library part name.
In case of Library Parts coming from versions earlier than ArchiCAD 8, there was no such thing as GUID. So when such a Library Part is encountered in the file, ArchiCAD will fill out its GUID with zeros. It also knows that it does not have to deal with the first 2 steps of the identification procedure and tries to match it by name.

Example:
Let us say we create a new Library Part. We choose the 'Model Element' Library Part for its Template. The GUID of this Template is
{103E8D2C-8230-42E1-9597-46F84CCE28C0}-{CE15CD1D-E6C8-4C6B-B919-C4E367D3983A}.
We save the Library Part under the name of 'Chair 1.gsm'. Its GUID becomes
{5E258C98-C74E-43E6-9F8A-894F2F9A3E22}-{9AD91219-5A87-4C64-8F32-84CB4DFB5E05}.
As you can see this is completely different from the previous number. If we make some modifications on it, save it, then check its GUID, it will become
{5E258C98-C74E-43E6-9F8A-894F2F9A3E22}-{ACFAA215-4B96-4CA2-9277-4C613AD50AC7.
As you can see, the MainID part of the GUID has not changed, but the RevisionID part has. Now, if we resave this Library Part using the Save as... command of the File menu under the name of 'Chair 2.gsm', then its GUID will be
{463F5328-53EC-4255-AC9F-614AB6B26C10}-{7521BF5D-66E3-4A62-8FD3-E5DFA4B245B7}
it becomes a completely different GUID.

It can happen that this new 'Chair 2.gsm' is renamed 'Chair 1.gsm'. This will not cause problems for ArchiCAD or the user for the following reason: First of all, neither Windows, nor Mac does not allow two identically named files in the same folder, so if you have two Library Part with the same name in your loaded Libraries, they will have to be located in two different folders.
If you loaded two Libraries, one with the original 'Chair 1.gsm' in it, and the other with the saved-as-Chair 2.gsm-renamed to Chair 1.gsm in it, ArchiCAD's Status Window would report to you the two Library Part under its 'Duplicate Names' section. This is because their names are the same, but their GUID is not. If you had two 'Chair 1.gsm' files in the loaded libraries - one the original, and another that was copied from it, then modified and saved (but not Saved as...) -, their MainID would stay the same, so they would be reported under the 'Duplicate Library Parts' section of the Status Window.

So, when two or more library objects with the same name are loaded, with the help of GUID ArchiCAD can tell if the parts are actually identical or if one of them is a different revision, or actually a totally different object.

How to know what the exact GUID of a Library Object is
For this, you need to know that the GUID is displayed in one place in ArchiCAD: when a Library Object is opened for editing, clicking the Select Subtype... button will bring up another Dialog.


The Select Subtype... button of the Library Editor

Normally, the GUID you see here is not that of the edited Library Part, but the GUID of its parent element. In the below screen capture you can see that the selected element is not 'Armchair 01.gsm', but its direct parent element, 'Seating'. Its Name, Version, GUID and Location are shown.

If you want to see the GUID of Library Part, you need to use the following menu command:
File\GDL Objects\Open Object by Subtype...
Then you will need to remember where the direct parent element of your Library Part was located within the Library Subtype Hierarchy. Library Objects will be displayed with green color in the list.

Now you will see the GUID of the Library Object displayed.

If in any case there is a clash of GUIDs between Library Parts within loaded libraries, the Library Loading Report will notify you with a Duplicate Library Part alert. In this case, you will also see the GUID of the Library Parts involved.

The reverse is also true: if there is no alert displayed by the Library Loading Report after all libraries are loaded successfully, you can be sure there are no two Library Parts with the same GUID in your loaded libraries.

How it works with Macros:
Consider the example of a kitchen cabinet and a standard door. Both might call another object named "Knob" but the cabinet knob and the doorknob might be entirely different files. This situation could happen when third party developers and product manufacturers around the world are independently making thousands of GDL objects. Because of the GUID, ArchiCAD can use a wide range of library parts without constraining GDL developers to using unique part names. This allows part names to be simple to understand by the user, and sophisticated enough under the hood for ArchiCAD to manage large and complex libraries. It also facilitates a new strategy to update placed library parts with new versions. (This point will be described in more detail below.)

When a Library Part's Scripts contain macro calls, ArchiCAD checks if the macro with the specified macro name exists in the loaded libraries. If it does, it will include its GUID information in the Library Part calling it, when the Library Part is saved. So macro references are identified just as normal Library Objects: first by GUID, then by MainID, then by name. Let us say, you have a Library Part containing a macro call to a macro with a certain GUID. Later another Library is loaded that contains a macro with the same name, but that macro has a different GUID. If the Library Object calling the macro is modified and saved, ArchiCAD will look in the loaded libraries for a macro with the same GUID. It will not find any. Then it will look for one with the same MainID. It will not find any. So it will look for a macro with the same name. It will find one, will take its GUID, and this GUID will be saved with the macro reference overwriting the previous value of the GUID value stored for that macro reference.
This means that you should not have several macros with the same name loaded with libraries, if you want to modify your Library Parts, because when the Library Part is saved, if it does not find a GUID match or a MainID match, it will take the first macro that matches the name and that will be a random selection beyond the control of the user.
This same rule applies to any operation that result in Library Parts being changed and saved or updated.

Example Situations:
Opening a project in ArchiCAD 8.1 (or later versions) that was started in ArchiCAD 8 r3
When loading the "ArchiCAD Library 8" and the "ArchiCAD Library 8.1", library parts in the project will continue to reference the 8.0 versions, even if there are updated versions in the 8.1 library with the same name.

When loading the "ArchiCAD Library 8.1" instead of the "ArchiCAD Library 8", the library parts in the project will reference the new versions in the new library. Some of the library parts in the project will have new names because the names were changed in a file manager rather than by using "Save as..." in ArchiCAD.

In this later case, the objects would not really be different, even though the names changed. But later reissues of the ArchiCAD Library may have programming changes to these library parts without changes to the names. If so, then the new library parts would replace the older versions in the project with the final result being that library parts from 8.0 had been replaced by new parts that have new names and new GUIDs.

Opening a project in ArchiCAD 8.1 (or later versions) that was started in ArchiCAD 7.0
In the ArchiCAD 7.0 library no GUID was used so if loading a file from this version, the identification in version 8 will be done by name.

When loading the "ArchiCAD Library 7.0", library parts in the project will continue to reference the 7.0 versions, and the placed objects will be correctly found.

When loading the "ArchiCAD Library 7.0" and the "ArchiCAD Library 8.1", library parts in the project will continue to reference the 7.0 versions, and the placed objects will be correctly found, if it is not a Library Part with a duplicate file name (the Library Part with the file name exists in both loaded Libraries). But if the Library Part exists in both Libraries, the object will be randomly selected from the two possible locations.

When loading the "ArchiCAD Library 8.1", library parts in the project will reference the 8.1 versions, if Library Parts with such names can be found in the 8.1 Library. The parameter values of Library Parts will remain. If the 8.1 library part contains new parameters, they will get their default values. If the script has changed since 7.0, the new script will run.

Page last updated: Monday, October 4, 2004

Copyright © 2009 - Graphisoft R&D Zrt. All rights reserved worldwide. Terms of Use | Privacy Policy