Work in progress: Native Altium Importer

Check first on simpler files you may have, to verify your Altium version is broadly ok/compatible.
If you can spare the time, you could try delete of ‘likely suspects’ until the file does load.
Look at example here that have loaded, but complex shapes/pads might be a place to start.

you can just report the exception without the board. If its something like padstack != SIMPLE, thats actually a warning (which I implemented as assert in development, because it was so simple to integrate). Just click continue. The reason is that KiCad does not support complex padstacks yet.

I know, I need to improve warnings to look like in the eagle importer, where a list of possible issues appears at the end.

Annotation 2020-02-26 231916

if it is any consolation, AtoK failed as well .

What Altium version do you use? Can you send me an empty boardfile?

The latest future roadmap


mentions initial spec by Orson for the padstack. Where to find this ?

Hi all,

I’ve just compiled a debug build of this branch of KiCAD. In case somebody also wants to do this, here are the commands I’ve issued after installing msys2 64 bit:

Cheers,
Cedric

pacman -Suy
pacman -Su

pacman -S base-devel \
          git \
          mingw-w64-x86_64-cmake \
          mingw-w64-x86_64-doxygen \
          mingw-w64-x86_64-gcc \
          mingw-w64-x86_64-python2 \
          mingw-w64-x86_64-pkg-config \
          mingw-w64-x86_64-swig \
          mingw-w64-x86_64-boost \
          mingw-w64-x86_64-cairo \
          mingw-w64-x86_64-glew \
          mingw-w64-x86_64-curl \
          mingw-w64-x86_64-wxPython \
          mingw-w64-x86_64-wxWidgets \
          mingw-w64-x86_64-toolchain \
          mingw-w64-x86_64-glm \
          mingw-w64-x86_64-oce \
          mingw-w64-x86_64-ngspice

git clone https://gitlab.com/pointhi/kicad.git
cd kicad
git checkout altium_import

mkdir -p build/debug               
cd build/debug
cmake -DCMAKE_BUILD_TYPE=Debug \
      -G "MSYS Makefiles" \
      -DCMAKE_PREFIX_PATH=/mingw64 \
      -DCMAKE_INSTALL_PREFIX=/mingw64 \
      -DDEFAULT_INSTALL_PATH=/mingw64 \
      ../../
make -j 7 #adjust for your number of cores
make install

After that you can find start the executables from C:\msys64\mingw64\bin

After starting pcbnew.exe in stand alone mode, you can choose file -> import non kicad board file, and point to your Altium file.

Issue the following commands to update KiCAD to the latest version:

cd ~/kicad
git pull
git log
cd build/debug/
make
make install

1 Like

I’ve looked around in Kicad, the PCB editor and the schematic editor, but I could not find the “Import Altium project” button.

Did I look in the wrong place, or should I open Altium files in another way?

It was told above in the post #60: Work in progress: Native Altium Importer

Thanks, I’ve edited my post above (71) to reflect this

I have made an Altium schematic that failed to load in KiCAD. it generates the error “IO error: Unable to read file” Followed by the error “XML parsing error: ‘not well-formed (invalid token)’ at line 1”

I assume importing of schematic files is not implemented yet?

Steps I’ve taken:

  1. Open eeschema.exe by double click on it
  2. File-import non KiCAD schematic
  3. enter . into the file name
  4. double click Sheet1.Schdoc Now the error "Error loading schematic . IO error: Unable to read file " from sch_eagle_plugin.cpp:Load()line:397
  5. Click OK. now this error comes up: “XML parsing error: ‘not well-formed (invalid token)’ at line 1”

My versions:
Application: Eeschema
Version: (5.99.0-1010-gc165d4bde), debug build
Libraries:
wxWidgets 3.0.4
libcurl/7.68.0 OpenSSL/1.1.1d (Schannel) zlib/1.2.11 brotli/1.0.7 libidn2/2.3.0 libpsl/0.21.0 (+libidn2/2.3.0) libssh2/1.9.0 nghttp2/1.40.0
Platform: Windows 7 (build 7601, Service Pack 1), 64-bit edition, 64 bit, Little endian, wxMSW
Build Info:
Build date: Feb 29 2020 20:26:55
wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8)
Boost: 1.72.0
OpenCASCADE Community Edition: 6.9.1
Curl: 7.68.0
Compiler: GCC 9.2.0 with C++ ABI 1013

Build settings:
KICAD_SCRIPTING=ON
KICAD_SCRIPTING_MODULES=ON
KICAD_SCRIPTING_PYTHON3=OFF
KICAD_SCRIPTING_WXPYTHON=ON
KICAD_SCRIPTING_WXPYTHON_PHOENIX=OFF
KICAD_SCRIPTING_ACTION_MENU=ON
BUILD_GITHUB_PLUGIN=ON
KICAD_USE_OCE=ON
KICAD_USE_OCC=OFF
KICAD_SPICE=ON
KICAD_STDLIB_DEBUG=OFF
KICAD_STDLIB_LIGHT_DEBUG=OFF
KICAD_SANITIZE=OFF

Altium designer 20.0.13 build 296

Thomas’ importer currently only handles PCBs, not schematics. The “import non KiCad schematic” function only supports Eagle at the moment.

1 Like

@nickoe
Are you making available nightly builds with this patch anywhere? The last link from you above seems to just have the 7-day-old build. If not, could you generate a new build and post the link here? Thank you!

It has been built a few days ago, just check the patched folder against the commit sha in pointhis branch to see how old it is.

https://kicad-downloads.s3.cern.ch/windows/testing/patched/kicad-patched-623-5.99.0-1010-gc165d4bde-x86_64.exe

I made an Altium file that crashes the importer. In altium 20, I’ve removed 2 tracks. Link to the file:
https://www.mediafire.com/file/kkdjos4gj1n3bmk/IceZUM_Core_HX1K.PcbDoc/file
Steps taken:
1 Run C:\msys64\mingw64\bin\pcbnew.exe
2 Choose File-import non-KiCAD board file
3 Navigate to the correct folder, set the filetype to *.pcbdoc and open IceZUM_Core_HX1K.PcbDoc
4 See the error “Unhandled exception class: St12out_of_range what: bitset::set:__position(which is 18446744073709551615) >= _Nb(which is 51)”
5 Press OK, and PcbNew closes.

My versions:
Application: Pcbnew
Version: (5.99.0-1012-g13f5d39e2), debug build
Libraries:
wxWidgets 3.0.4
libcurl/7.68.0 OpenSSL/1.1.1d (Schannel) zlib/1.2.11 brotli/1.0.7 libidn2/2.3.0 libpsl/0.21.0 (+libidn2/2.3.0) libssh2/1.9.0 nghttp2/1.40.0
Platform: Windows 7 (build 7601, Service Pack 1), 64-bit edition, 64 bit, Little endian, wxMSW
Build Info:
Build date: Mar 3 2020 19:34:05
wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8)
Boost: 1.72.0
OpenCASCADE Community Edition: 6.9.1
Curl: 7.68.0
Compiler: GCC 9.2.0 with C++ ABI 1013

Build settings:
KICAD_SCRIPTING=ON
KICAD_SCRIPTING_MODULES=ON
KICAD_SCRIPTING_PYTHON3=OFF
KICAD_SCRIPTING_WXPYTHON=ON
KICAD_SCRIPTING_WXPYTHON_PHOENIX=OFF
KICAD_SCRIPTING_ACTION_MENU=ON
BUILD_GITHUB_PLUGIN=ON
KICAD_USE_OCE=ON
KICAD_USE_OCC=OFF
KICAD_SPICE=ON
KICAD_STDLIB_DEBUG=OFF
KICAD_STDLIB_LIGHT_DEBUG=OFF
KICAD_SANITIZE=OFF

Altium 20.0.1.3

@cedric Please try the latest build while you are at it.

https://kicad-downloads.s3.cern.ch/windows/testing/patched/kicad-patched-634-5.99.0-1222-gbef8587d3-x86_64.exe

I made an Altium file that crashes the importer. In altium 20, I’ve removed 2 tracks. Link to the file:
https://www.mediafire.com/file/kkdjos4gj1n3bmk/IceZUM_Core_HX1K.PcbDoc/file
Steps taken:
1 Run C:\Users\cedric\Downloads\kicad-patched-634-5.99.0-1222-gbef8587d3-x86_64\bin\pcbnew.exe (I’ve used 7zip to extract the downloaded exe)
2 Choose File-import non-KiCAD board file
3 Navigate to the correct folder, set the filetype to *.pcbdoc and open IceZUM_Core_HX1K.PcbDoc
4 See the error “An unhandled exception occured. Press “Abort” to terminate the program, Retry to exit the program normally and “Ignore to try to continue”
5 Press retry. Now pcbnew closes.

My versions:
Application: Pcbnew
Version: (5.99.0-1222-gbef8587d3), release build
Libraries:
wxWidgets 3.0.4
libcurl/7.66.0 OpenSSL/1.1.1d (Schannel) zlib/1.2.11 brotli/1.0.7 libidn2/2.2.0 libpsl/0.21.0 (+libidn2/2.1.1) nghttp2/1.39.2
Platform: Windows 7 (build 7601, Service Pack 1), 64-bit edition, 64 bit, Little endian, wxMSW
Build Info:
Build date: Mar 25 2020 14:34:47
wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8)
Boost: 1.71.0
OpenCASCADE Community Edition: 6.9.1
Curl: 7.66.0
Compiler: GCC 9.2.0 with C++ ABI 1013

Build settings:
KICAD_SCRIPTING=ON
KICAD_SCRIPTING_MODULES=ON
KICAD_SCRIPTING_PYTHON3=OFF
KICAD_SCRIPTING_WXPYTHON=ON
KICAD_SCRIPTING_WXPYTHON_PHOENIX=OFF
KICAD_SCRIPTING_ACTION_MENU=ON
BUILD_GITHUB_PLUGIN=ON
KICAD_USE_OCE=ON
KICAD_USE_OCC=OFF
KICAD_SPICE=ON

1 Like

@pointhi look more random characters because discorse is wierd

Thanks. I fixed it in commit 6657122ed

3 Likes

I managed to improve the Importer quite a bit in the last days:

  • Copper Regions are finally correctly detected
  • No more artifacts on hatched zones
  • Fix crash due to layer handling issues
  • Better error reporting and more checks
  • Dimensions are now supported also in Circuit Studio import
  • Code cleanup and style fixes
4 Likes

Hi there,

Is there anything I can do that makes it easier to start working on the schematic importer?

Cheers,
Cedric