Problems importing AutoCAD dxf into PCBNew

Hey folks,

I know this has been discussed a few times on the forum, but looking through previous posts I’m afraid I’ve not been able to find a solution to my particular problem yet.

I’m trying to import a DXF file from AutoCAD into PCBNew, to guide my placement of components. The board is designed to sit behind a control panel, so the placement of the LEDs is critical. However, when I import the DXF, only a random part of the file appears in PCBNew - sometimes it’s some of the edges and a couple of cutouts, other times it’s a completely different drawing.

I’ve tried exporting to different versions of DXF from AutoCAD, ranging from 2013 and 2010 to the old R12 (as mentioned elsewhere on the forum), and tried different exporting methods too. Unfortunately I’m at a loss now, and was hoping if someone could help me diagnose the problem :frowning:

Background info:
Windows 7 Enterprise SP1 64b
i5-6300U, 8GB RAM
KiCAD 5.0.0 release build

LED cutouts.dxf (14.9 KB)

something goofy about your DXF… I was able to open it ok in solidworks, but inkscape which I’ve never had a DXF issue with also barfed on it.

A screenshot of how it should look like could help us determine what could be wrong.

For reference this is what your file looks like when opened in libre cad.

1 Like

Thanks for the reply - aye, after posting this topic someone here pointed out to me that I’d dun goofed, and left most of my layers off - leaving loads of unwanted crap in the exported DXF.

Removing all that solved the problem, so I’ve flagged the topic for removal - a classic PEBKAC on my part!

Cheers for the help all the same!

Daniel

2 Likes

The process of checking the DXF with Inkscape and LibreCad is useful to others, so I would like to leave this topic up

1 Like

Reopened on request by @danners430

Thanks @davidsrsb

So after my PEBKAC, I though I’d solved the problem… well, sort of… The problem is now reoccurring, and I’ve no clue why!! I had a version of the DXF that worked, but I tried (perhaps foolishly) removing some of the excess lines… then it stopped working. I made a copy, and rolled my change back, and it worked again… eh??

This is what it should look like:

And this is what came out after the alterations…
PCBNew%20problem

These are the two files - the original, functioning drawing, and the “new and improved”, and well and truly broken, drawing…
LED cutouts - Problem.dxf (180.0 KB)
LED cutouts.dxf (187.0 KB)

Both look sensible in DWG TrueView 2018 and LibreCAD 2.2.0-rc1

1 Like

Precicely xD they’re literally identical in every possible way, except on the “new” one I removed excess lines on the “Engraving” layer, to leave only the cutouts which are of interest to me… wurt da whit?

I removed the extra layers and saved in LC… it seems to load now
LED cutouts - Problem removed.dxf (38.8 KB)

may be related to this

1 Like

Ah, OK… so is it perhaps the physical prescence of the unused layers that’s causing the problem?

OK, new update. I have solved, it seems, the problem, so this is what caused it for future reference:

A combination of two factors caused the problems:

  1. The blocks I was interested in were at around 2000,0 on the coordinate system, not at 0,0. Therefore when I tried to insert them into KiCAD, they did insert properly, just about “2m” off to the right, so I never saw them until I zoomed riiiight out and panned right. Moving the blocks to a “home” position at 0,0 solved this particular problem.
  2. I had a large number of unused blocks still in the drawing - thats what the “problem” photo was, a mish mash of all the unused blocks, being inserted at 0,0. Purging these blocks from the drawing resulted in these artefacts no longer importing into KiCAD.

Hopefully this will all help someone in the future… a combination of a massive PEBKAC on my part by drawing at 2000,0, and a strange artefact of KiCAD’s DXF import tool :slight_smile:

3 Likes

Thanks to @maui for the bug report. The original file should not now import correctly in 5.1.5RC1. Please test tomorrow’s nightly when you get a chance to verify it works for you.

Should now? ----------

1 Like

Doh. Yes. Fat fingered that one :slight_smile:

@Seth_h
it seems the LED cutouts - Problem.dxf gets loaded correctly (file @ post #9),
but not the first OP file LED cutouts.dxf (file @ post #1)

Ah. True. But it wasn’t in the bug report so I didn’t see it! :blush:

1 Like