Index: dxf.c =================================================================== --- dxf.c (revision 29236) +++ dxf.c (revision 29237) @@ -75,6 +75,7 @@ unsigned long handle; lht_doc_t *temp; const char *layer_name; + long drawn_objs; unsigned force_thin:1; unsigned enable_force_thin:1; unsigned poly_fill:1; @@ -280,6 +281,7 @@ options = dxf_values; } + dxf_ctx.drawn_objs = 0; pcb_cam_begin(PCB, &dxf_cam, &xform, options[HA_cam].str, dxf_attribute_list, NUM_OPTIONS, options); filename = options[HA_dxffile].str; @@ -334,9 +336,14 @@ pcb_message(PCB_MSG_ERROR, "Can't render dxf template header\n"); fclose(dxf_ctx.f); - if (pcb_cam_end(&dxf_cam) == 0) + if (pcb_cam_end(&dxf_cam) == 0) { if (!dxf_cam.okempty_group) pcb_message(PCB_MSG_ERROR, "dxf cam export for '%s' failed to produce any content (layer group missing)\n", options[HA_cam].str); + } + else if (dxf_ctx.drawn_objs == 0) { + if (!dxf_cam.okempty_content) + pcb_message(PCB_MSG_ERROR, "dxf cam export for '%s' failed to produce any content (no objects)\n", options[HA_cam].str); + } } static int dxf_parse_arguments(pcb_hid_t *hid, int *argc, char ***argv) Index: dxf_draw.c =================================================================== --- dxf_draw.c (revision 29236) +++ dxf_draw.c (revision 29237) @@ -29,6 +29,7 @@ static void dxf_draw_handle(dxf_ctx_t *ctx) { + ctx->drawn_objs++; ctx->handle++; fprintf(ctx->f, "5\n%lu\n", ctx->handle); } @@ -145,6 +146,8 @@ dxf_ctx_t *ctx = &dxf_ctx; int n, to; + dxf_ctx.drawn_objs++; + #if HATCH_NEEDS_BBOX pcb_coord_t x_min, x_max, y_min, y_max; x_max = x_min = *x + dx;