Advanced Compiling

While cdcompileui.exe can be used to compile components, it only allows one icon to be embedded. This article describes how to use cdcompile.exe to embed a separate thumbnail for each configuration of your component.

Creating a Compilation Description

The first step is to create a compilation description xml file. This file holds information about what should be embedded within the .cdcom file.

The compilation file will look something like this:

<?xml version="1.0" encoding="utf-8"?>
<cdcom markupversion="1.0">
  <component path="C:\Users\Username\Documents\resistor.xml">
    <icon>C:\Users\Username\Documents\Resistor icon.png</icon>
    <icon configuration="Potentiometer">D:\Users\Username\Documents\Potentiometer icon.png</icon>
    <icon configuration="LDR">C:\Users\Username\Documents\LDR icon.png</icon>
    <icon configuration="Thermistor">C:\Users\Username\Documents\Thermistor icon.png</icon>
    <icon configuration="Variable Resistor">C:\Users\Username\Documents\Variable resistor icon.png</icon>
  </component>
</cdcom>

The component tag has one attribute, "path", which contains the full path to the XML component you want to compile.

The component tag can contain one or more icon tags, which hold the full path to the icons which will be embedded. It is recommended that the first icon does not have a "configuration" attribute - this will be used as the default icon for the component, and for any configurations without their own icon.

Additional icon tags should have a "configuration" attribute, which contains the name of the configuration which they will be used for.

Compiling

Once you have made the description file, download the Circuit Diagram Tools and unzip the file to a location on your computer.

  1. Open command prompt (click on the start menu and then type command prompt).
  2. The working directory must be set to the folder containing cdcompile.exe, which you unzipped earlier. To do this, type cd directory into the command prompt window, replacing directory with the path to the folder, and press enter.
  3. Type cdcompile.exe -i inputfile -o outputfile, replacing inputfile with the path to the description file you made earlier, and outputfile with the path of the file you want to create.

For example:

cdcompile.exe -i "C:\Users\Username\Documents\CompileDescription.xml" -o "C:\Users\Username\Documents\component.cdcom"

When you press enter, your component will be compiled. You can now install the newly created component.