Index: trunk/src_plugins/import_dsn/dsn.c =================================================================== --- trunk/src_plugins/import_dsn/dsn.c (revision 6658) +++ trunk/src_plugins/import_dsn/dsn.c (revision 6659) @@ -120,7 +120,7 @@ } } -static void parse_via(pcb_coord_t clear, const gsxl_node_t *via) +static void parse_via(pcb_coord_t clear, const gsxl_node_t *via, dsn_type_t type) { const gsxl_node_t *c = via->children->next; const char *name = via->children->str; @@ -128,6 +128,7 @@ const char *sy = c->next->str; pcb_bool succ; pcb_coord_t x, y, dia, drill; + const char *unit = (type == TYPE_PCB) ? "mm" : "nm"; if (strncmp(name, "via_", 4) != 0) { pcb_message(PCB_MSG_ERROR, "import_dsn: skipping via with invalid name (prefix): %s\n", name); @@ -140,12 +141,12 @@ return; } - x = pcb_get_value(sx, "mm", NULL, &succ); + x = pcb_get_value(sx, unit, NULL, &succ); if (!succ) { pcb_message(PCB_MSG_ERROR, "import_dsn: skipping via segment because x coord is invalid: %s\n", sx); return; } - y = pcb_get_value(sy, "mm", NULL, &succ); + y = pcb_get_value(sy, unit, NULL, &succ); if (!succ) { pcb_message(PCB_MSG_ERROR, "import_dsn: skipping via segment because x coord is invalid: %s\n", sy); return; @@ -239,7 +240,7 @@ if (strcmp(w->str, "wire") == 0) parse_wire(&nlines, clear, w, type); if (strcmp(w->str, "via") == 0) { - parse_via(clear, w); + parse_via(clear, w, type); nvias++; } } @@ -267,6 +268,10 @@ for(w = n->children; w != NULL; w = w->next) { if (strcmp(w->str, "wire") == 0) parse_wire(&nlines, clear, w, type); + if (strcmp(w->str, "via") == 0) { + parse_via(clear, w, type); + nvias++; + } } } break;