Conversion Between Library Formats

This article describes possible ways of converting between different library file formats. The following illustrations show the process in general, and below that, you find the detailed conversion steps.

Conversion in Archicad:

Conversion of library parts in Archicad

Conversion with the LP_XMLConverter:

Conversion with the LP_XMLConverter

LP_XMLConverter

As Archicad can not solve all conversions (see conversion between hsf and .gsm), sooner or later, you will need to use the LP_XMLConverter.exe. Every Archicad is shipped with the converter included (in the folder where Archicad is installed, next to Archicad.exe), but you can also use the one provided in the Library Developer Toolkit.

When using the LP_XMLConverter, you have to open Command Prompt on Windows or Terminal on MacOS, then drag the LP_XMLConverter.exe (Windows) or LP_XMLConverter.app (Mac) into its window, add the required arguments (detailed below in each section) after it and run the command by hitting enter.

More on the converter can be found here: How to use the LP_XMLConverter tool?.

Conversion from .libpack to hsf

.libpack → .lcf

In Archicad:

  • On the Edit GDL Library Parts toolbar (Window/Toolbars/Edit GDL Library Parts), open the dropdown on the very left
    Extract library package
  • Select Extract Library Package…
  • Browse for the library package you wish to extract
  • Browse for a folder into which you want to extract the library package

With LP_XMLConverter:

  • Open Command Prompt/Terminal
  • Drag the converter into it, then add the needed arguments so the command looks like this:
    Windows:
    <path>\LP_XMLConverter.exe extractpackage <libpack path> <path of folder to extract to>
    
    Mac:
    <path>\LP_XMLConverter.app extractpackage <libpack path> <path of folder to extract to>
  • Hit enter to run the command

Extracted library package

After converting using either of the two methods, the destination folder contains a .lcf file and additional files used for the library package functions. A fully functional library package after extraction should look like this:

  • Localization (folder)
    • Dictionaries (folder)
      • fileNamesLOC.po
      • folderNamesLOC.po
      • symbolStringsLOC.po
    • pathNameTableLOC.json
  • <lcfname>.lcf
  • localizationData.info
  • mappingDefinitions.json
  • package.info

For the next conversion step, you will only need the .lcf file.

.lcf → .gsm

In Archicad:

  • Select Extract a Container… from File/Libraries and Objects or from Edit GDL Library Parts toolbar
    Extract a container
  • Browse for the .lcf you wish to extract
  • Browse for a folder into which you want to extract the library container file

With LP_XMLConverter:

  • Open Command Prompt/Terminal
  • Drag the converter into it, then add the needed arguments so the command looks like this:
    Windows:
    <path>\LP_XMLConverter.exe extractcontainer <lcf path> <path of folder to extract to>
    
    Mac:
    <path>\LP_XMLConverter.app extractcontainer <lcf path> <path of folder to extract to>
  • Hit enter to run the command

.gsm → hsf

In Archicad:

  • Not available

With LP_XMLConverter:

  • Open Command Prompt/Terminal
  • Drag the converter into it, then add the needed arguments so the command looks like this:
    Windows:
    <path>\LP_XMLConverter.exe l2hsf <gsm folder path> <target folder path for hsf creation>
    
    Mac:
    <path>\LP_XMLConverter.app l2hsf <gsm folder path> <target folder path for hsf creation>
  • Hit enter to run the command

Conversion from hsf to .libpack

hsf → .gsm

In Archicad:

  • Not available

With LP_XMLConverter:

  • Open Command Prompt/Terminal
  • Drag the converter into it, then add the needed arguments so the command looks like this:
    Windows:
    <path>\LP_XMLConverter.exe makelibrary -format hsf <hsf folder path> <target folder path>
    
    Mac:
    <path>\LP_XMLConverter.app makelibrary -format hsf <hsf folder path> <target folder path>
  • Hit enter to run the command
    • Many errors may occur (missing images, macros, or subtypes) if you didn’t build the dependency library packages. You can ignore these errors.
      • To avoid these errors you have to have the dependency libraries (built-in + dependency library packages) built in the target folder.
      • For this, the easiest way is to extract the .libpack and .lcf files (see steps above).
        • built-in library can be found next to the Archicad.exe, called BuiltInLibraryParts.lcf
        • all library packages can be found under Archicad Library Packages
    • MappingDefinitions.json is created in the target folder as well; make sure to move it elsewhere before creating the .lcf (the MappingDefinitions.json should be next to the .lcf when creating the library package, not inside the .lcf).

.gsm → .lcf

In Archicad:

  • First, you have to add your library folder to the current Archicad project through the Library Manager
  • Select Create Container… from File/Libraries and Objects or from Edit GDL Library Parts toolbar
  • From the library tree of the project, select the folder you wish to turn into a .lcf
  • Browse for a folder into which you want to create the library container file
  • After you click on Save, check the created .lcf on the given path, then close the Create Library Container dialog

With LP_XMLConverter:

  • Open Command Prompt/Terminal
  • Drag the converter into it, then add the needed arguments so the command looks like this:
    Windows:
    <path>\LP_XMLConverter.exe createcontainer <.lcf destination path> <gsm folder path>
    
    Mac:
    <path>\LP_XMLConverter.app createcontainer <.lcf destination path> <gsm folder path>
  • Hit enter to run the command

Assembling library package files

Create an empty folder and copy the .lcf and additional files to achieve a folder structure that is similar to this:

.lcf → .libpack

In Archicad:

  • After you organized your .lcf and additional files into a folder, load this folder into an Archicad project
  • Select Create Library Package… from Edit GDL Library Parts toolbar’s dropdown
  • Select the folder from the library tree you wish to package
  • Browse for a path where the .libpack will be created
  • Click on Save
  • If you have done everything right, the library package is created and can be added via the library manager
    • If an error message comes, check the session report, which lists all missing, invalid, and unneeded files
    • If unneeded files are listed, check your pathname table files

With LP_XMLConverter:

  • Open Command Prompt/Terminal
  • Drag the converter into it, then add the needed arguments so the command looks like this:
    Windows:
    <path>\LP_XMLConverter.exe createpackage <.libpack destination path> <input folder> -checkpackage
    
    Mac:
    <path>\LP_XMLConverter.app createpackage <.libpack destination path> <input folder> -checkpackage
  • Hit enter to run the command
  • The Command Prompt/Terminal window lists any errors that may occur during library package creation, such as missing, invalid, or unneeded files. Otherwise, the library package is created successfully.

Keep in mind:

  • Library packages loaded into Archicad are not overwriteable, so make sure to remove them from the library manager before trying to rebuild a package. If the build cannot overwrite the file, no warning comes, and the -checkpackage checks the unchanged library package.
  • If errors occur, the library package is still created but will only function as a .lcf file. You can notice this in Archicad:
    • Instead of the folder structures defined in the pathnameTable.json, the source folder structure applies in the Tool Settings Dialogs.
    • Changing Mapping Value Tables does not affect the library parts in the package.
    • Translations are not applied to the library parts in the package.