How do I snap to the center of holes when dimensioning?

if you have i.e. a dxf representation of your mounting holes and may be a 2D maximum pcb board size, the best is to import your dxf into kicad pcbnew and use it as a reference for your pcb edges… that should be done as a first step in designing your board
http://docs.kicad.org/master/en/pcbnew.html#_creating_a_board
6.1.2. Using a DXF drawing for the board outline

Maurice

No, of course not. And KiCAD does NOT make it easy! As your comment implies, it goes beyond mounting holes to things like notches and cutouts and fillets and edges that don’t meet at right angles.

Where objects must be located precisely - edges, mounting holes, front panel connectors and controls - use the “Properties” dialogs. Get “Properties” by hovering the cursor over an object and press “E”, or right-click, select the object of interest, then “Edit Properties”.

Enter the absolute location of the object down to a few Angstroms, or picofurlongs, or whatever your favorite units are.

Of course, actually determining what the absolute location should be is typically an absolute pain in the keister! It would be SO HELPFUL if we could define co-ordinate origins at some convenient place on a board - a corner (any corner!), the centroid, a mounting hole or locating notch, etc. I have used two methods to work around KiCAD’s shortcomings in this area. For either one it’s easier to locate the board outline, mounting holes, and possibly critical component locations as the first step, before importing the netlist, etc:

  1. Start the board layout by positioning a reference location at some place in the coordinate system that makes mental math easier. The “reference location” on your board might be a corner, the position of a switch or connector, etc. I’m rather fond of using the absolute location {2.000 in, 1.000 in} for the upper left corner of my board. Just remember to add or subtract the “1” or “2” inch offset when placing all of the edge cuts, mounting holes, etc.

  2. Start the board layout by positioning a corner at the absolute origin {0.000, 0.000}. Place all of the edge cuts, mounting holes, critical components (or temporary lines marking their positions). Ignore the drawing frame, title block, etc. After everything is in place, make a block selection of all of it. Either do a right-click and “Move Block exactly”, or tap the spacebar and use the relative position readout (bottom of the screen) to relocate those objects where you want to work with them.

My mounting holes are actually defined as footprints. On each mounting hole footprint I place two thin lines (6 mils thick) to mark the center of the hole. The lines are on the layer I will use for the board dimensions - “Dwgs.User” - but you may prefer “Cmts.User” or one of the ECO layers.

Those lines help me place the dimensions after the board is complete. And, they look kind of sexy in printed documentation - like I have my feces amalgamated when it comes to drafting a printed wiring board.

(150 mils works well for a #6 UNS screw. The heavy, inner, silkscreen circle marks the area under the screw head and the outer circle is the diameter of the washer.)
MountingHole_150mil_Washer.kicad_mod (1.1 KB)

Dale

2 Likes

Yup.
Other CAD tools have a 'Set Origin" button, and if you have something selected when you hit it, it figures you are trying to give it information and says
"You have selects Pin U1.5/Corner/Entity, use this as origin ?"

That cannot be hard to add to KiCad ?

1 Like

I think I have encountered that behavior on other tools. You still have to pay attention to what you’re doing. With circles in particular, you usually want the center point . . . but occasionally you want to refer to some point on the circumference.

Dale

I use a CAD program to get me a DXF drawing of all the important positions and import that. I also usually use full mm values during design to make it more convenient.

1 Like

I don’t find it that hard. It is a little time consuming though. Best method is DXF import. But I do it manually all the time.

I use the hit space bar, when the cursor is at the corner/important reference on my PCB design. Then the dx,dy co-ords in the status update as per the “origin”. This lets me know if my holes, connectors and so forth are out by whatever. I then use the ‘e’ and adjust the co-ords to get it smack on. Of course once I have done this, I check it, and if it’s still good, then I hit ‘e’ again and lock it in position.

The only really annoying thing, is the y axis is reversed and I always stuff that up. I would love it if we had a set origin though.

Hope that helps a little at least. I agree it could be made faster to do though. But KICAD is still mya favourite package ever. Most PCB’s I’ve made are in it. On design 126 now…and still discovering good bits/short cuts.

1 Like

Reading the followup comments I guess I’m not alone. :slight_smile:

I did not know about the space bar trick midworls08 mentioned.

Of course importing a dxf file is always an option, and, a mechanical layout is typically needed anyway.

Generally speaking the “mechanical” side of KiCad could be better.

Also noted was the snap grid/entity of LibreCAD. The trick is to know which snap condition is being met. I find that of AutoCAD (and other), where it indicates which snap will be used if you click is very helpful.

Where the limited CAD function is really noticed, for me at least, is drawing (especially editing) components and footprints. (having been a developer and instructor for packages like Medusa, CADDS, Solidworks, and AutoCAD has probably left me quite spoiled, or lazy, for drafting features though… :grinning: )

Thanks for the tips and suggestions!

Regards,
Mac

1 Like

Just want to add my 2 cents worth here. Being able to snap to the center of a pad or center of a track or any other entity for that matter is absolutely vital for a good CAD package. I come from years of using Altium and Protel 99, both of which have these features as standard. Without it you will almost certainly always end up with more or less lazy board editing (tracks not to center of pads, or unable to accurately measure between two entities that are off grid, or a track T intersection where the intersecting track is either too short or too long). I was really hoping this feature would be introduced in Kicad 5, but alas it does not appear to be quite there yet.

Aside from that, I am using Kicad 5 and enjoying the more structured approach and features it has over previous versions. My compliments to the team.

Hi folks,

I just want to say: I am also missing a function to reach the center of objects. Sometimes just to pull them (partly) into the grid. If someone from the “Team” is listening: this would be nice.

I am also missing a possibility to print a layout to bitmap (PNG). For my hobbyist purposes this would be nice.

However this is “Erbsenzählen”, in general V5 is really fun working with.

You can do most of that in v5. Select “always” for “magnetic pads” and tracks in Preferences. Select e.g. the measurement (caliper) tool and hover over the items. It snaps. Press M to select the Move tool. Now the item’s center is under the mouse cursor when you move it with arrow keys or with mouse.

@chris9: You can also use the Move Exactly tool. Or just set the coordinates in the Properties dialog. That way you can move items to the grid, as long as you know the grid point.

4 Likes

You are right eelik, the (M)ove command snaps to Pads and centerpoints. Im still learning … :blush:

We all are, it will be a while before volunteers have made tutorials for V5 as good as the V4 examples

1 Like

You can edit your .pcb in a text-editor.

-Make sure your holes is your CAD drawing is of type circle and export to DXF
-Import in Pcbnew
-Save the board .bcb
-Edit the file with text-editor:

Insert the e.g. pad with the same center position as your circles, example:

(gr_circle (center 175.0111 122.6236) (end 175.4611 122.6236) (layer Dwgs.User) (width 0))
(via (at 175.0111 122.6236) (size 0.8) (drill 0.4) (layers F.Cu B.Cu) (net 0))

Hint: place your circles (holes) in a unique layer so you can search for it in your pcb files if it has have many objects. In my example it’s located in “Dwgs.User”

There you match a via XY to the reference XY.
Is that move-via a common level of detail you need, or it is usually mounting holes and you use vias to avoid the part-ref ?

If you are doing that, you could write a Python script that checked XY and even R, if you wanted, or even with 2 concentric circles, you could likely extract X,Y,R,D ?

From the other comment thread, there is also this means to snap using Ctrl-R (Position Relative to),

If you import circles in DXF, you can use Select + Crtl-R (Position Relative to),

In that menu, is a choice for Select Anchor position , and that allows you to
Select part, or Via, then
Click [Select Anchor position] then Select DXF Circle
This pulls the XY of DXF Circle into the Anchor offset fields.
Click OK

Then the part centroid**, is placed on DXF circle centre.

Strangely SMD parts work well as origin is usually centroid, but headers place not the part move origin, but the centroid. That means another (eg +50 mil) step fix is needed

Or, you can query any circle and copy the X,Y one at a time into the part X,Y.
There is a feature request to be able to copy/paste more than one field, in the dialog boxes.
X,Y would be be most common use, but I could also see uses for copy of X,Y,R

** That Ctrl-R works on centroid seems strange, almost a bug, as it is not the move-origin ?
Seems to me if that is offered, there should be a choice in Position relative to, of Centroid, or Part Origin ?

I see Via move also has a Drag choice, which nicely keeps trace segments connected.
It would be nice is the Position relative to dialog, gave the choice of drag (even if just for vias)

1 Like

My how-to:

  1. Select KiCad object, e.g. pad or footprint
  2. Pres M to move
  3. Press CTRL+R (to open Position Relative dialog)
  4. Push “Select Anchor Position”
  5. Select circle/arc
  6. Pusk “OK” button (Enter will not do it).

@ PCB_Wiz, thanks once again

That’s really good to know (about Magnetic pads/tracks option). I just finished designing a new PCB in Kicad Version 5, and had this feature permanently enabled. I will however add 2 comments for future upgrade of this feature:

  1. The magnetic or snap capability should be extended to all entities on the pcb, not just conductive tracks. EG I see that lines on an ECO layer are not magnetic, and they should be.
  2. The ability to magnetically snap to centre should be an option that you can dynamically enable/disable in “mid track lay”. IE, while running a track from a pad (that I want to snap to) I then want to run a track to another track, but not snap to it’s centre. Perhaps this already exists, but I tried things like holding down shift while running a track, and it didn’t seem to have the desired effect. As part of this solution, have the magnetic snap capability disabled for hidden layers, and prioritize the currently selected layer for when there are numerous entities to snap to in close proximity to each other, but on different layers. I think in terms of the latter, you may already have that pretty much have covered.

Now that I have provided your developers with enough eye watering demands, I’ll finish by saying that Kicad version 5 is officially (from my perspective) a very useable package and I doubt I’ll ever be using anything else again. I look forward to donating towards your cause (as anybody should who finds use in Open Source software such as this). Thanks again.

I raised a bug report querying that choice of Centroid over Origin, and it seems a fix is already committed :slight_smile:

That fix will make this Position Relative To feature more generally useful for DXF-Snap tasks.

It does not work in v-5.1.5 but give you some idea.

in V-5.1.5 select a reference point on grid or any pad, set to zero Dx/Dy (space-bar). Select and snap to new item’s center )Ctrl+M), enter new x/y value and click OK for precise placement.

3 posts were split to a new topic: Split from: How do I snap to the center of holes when