Cadstar importer

I am trying to import some cadstar layouts into kicad. It works like a charm with all except one layout where I get the following error message:

Unknown node 'MANUAL' in 'LAYERPAIR -> 1'

The .cpa file has the following offending section (sorry, I cannot post our customers whole file:

(FORMAT LAYOUT 2 21)
...
(LAYERPAIR LP0 "(Through Hole)" 1 16
    (VIACODEREF VC0)
   )
   (LAYERPAIR LP1 "through hole" 1 16
    (VIACODEREF VC1)
   )
   (LAYERPAIR LP2 "1" 1 16
    (MANUAL)
   )
   (LAYERPAIR LP3 "2" 1 16
    (MANUAL)
   )
   (LAYERPAIR LP4 "3" 1 16
    (MANUAL)
   )
   (LAYERPAIR LP5 "4" 1 16
    (MANUAL)
   )
   (LAYERPAIR LP6 "5" 1 16
    (MANUAL)
   )
   (LAYERPAIR LP7 "6" 1 16
    (MANUAL)
   )
   (LAYERPAIR LP8 "7" 1 16
    (MANUAL)
   )
   (LAYERPAIR LP9 "8" 1 16
    (MANUAL)
   )
   (LAYERPAIR LP10 "9" 1 16
    (MANUAL)
   )
   (LAYERPAIR LP11 "10" 1 16
    (MANUAL)
   )
   (LAYERPAIR LP12 "11" 1 16
    (MANUAL)
   )
   (LAYERPAIR LP13 "12" 1 16
    (MANUAL)
   )
   (LAYERPAIR LP14 "13" 1 16
    (MANUAL)
   )
   (LAYERPAIR LP15 "14" 1 16
    (MANUAL)
   )
   (LAYERPAIR LP16 "15" 1 16
    (MANUAL)
   )
   (LAYERPAIR LP17 "0" 1 16
    (VIACODEREF VC1)
   )
...

Any idea how to fix this? I don’t know much about cadstar. Is there maybe a way to fix this inside of cadstar? I have no idea what these Layerpairs represent.

Edit: Added format Version at the top and pic of error message. This file might be very old.

My first guess is that you bumped into some unusual feature of cadstar and KiCad does not know what to do with it. If this is the case, then creating a bug report on gitlab (for KiCad) is likely the best thing to do.

Other possibilitie is that the cadstar file format changed over time, and KiCad’s importer can’t handle all file versions. Do these cadstar files have any version info embedded? Does the content of that file look similar to your other files?

1 Like

I added some information from the top of the file which I think might indicate the version number. This design is possibly very old (2001 or so). My cadstar version that I used to export the archive is Cadstar Version 2024.0.0.22.

I actually just tried and deleted that whole section from the cpa file and the export works. I cannot tell if anything is even missing. If it is, it is something very subtle.

Uploading the samples that trigger this is the only way for the developers to fix the issue. It is pretty unlikely that a developer has a Cadstar seat of the right version.

1 Like

I did a little search and “cadstar” is mentioned in 13 open issues on gitlab, and one of them is about:

Probably not necessary. Currently the importer seems to only handle layerpairs of the type "VIACODEREF"s . To fix my issue one would probably have to know what a layerpair “MANUAL” would translate to in kicad or what it even represents in cadstar. I am currently leaning towards that they can be ignored (at least in my case) since these nodes are not referenced anywhere else in the archive. Unlike e.g. the VIACODEREF at the beginning of my listing.

My solution for now is to delete all the nodes with “MANUAL” layerpairs from the archive in a text editor.

Yeah, that would indeed be a super nice feature, but it is unrelated to my issue.

The design (.pcb) might be old, but if you exported it with a rather recent version of Cadstar, the .cpa format will be that. I still have version 16, which generates archives with (FORMAT LAYOUT 2 18)

Layer pairs are used to assign the layers that vias can span. Mostly useful when using blind or buried vias. In your case, vias with code VC0 and VC1 are defined as through hole, so they span all layers. What the “MANUAL” entails, I have no idea.

1 Like

Thank you for the explanation, that makes a lot of sense conceptually. For now I have come to the conclusion that I can ignore the “MANUAL” layerpairs. I compared the layout in cadstar with the imported layout in kicad and everything seems to be in place as expected. Maybe the cardstar importer could be changed so that it ignores these and just gives a warning at the end that it is an unsupported feature.

At least raise an issue on GitLab with a sample, so that an interested developer has something to work on

I submitted a merge request on gitlab. Maybe a dev who better understands the Cadstar file format and the KiCad importer (@Qbort :wink:) has time to have look.