Altium, "Align to grid" question - Page 1
Forum section: electronics / general

author: incf
author_rank: Frequent Contributor
timestamp: January 20, 2025, 11:38:10 pm
content: I have an LED and a custom grid for LEDs. (It needs to be offset, so the global grid won't work)The LED is off grid. I would like to align it to the my custom grid for LEDs.Unfortunately, when I try to use the align to grid tool. It always uses the global grid (which lacks support for offsets). Even though the global grid is disabled, if the global grid was set to 100x100mm the part would be moved off screen to the nearest global grid coordinate when I click "align to grid".The exact center of the part it its (0,0)What are some easy ways to align the part's origin, or the part's center, or some edge of the part with the grid, without manually editing the X/Y coordinates.(Can scripts align parts to particular grids?)I feel as though I'd have to first align one LED to the grid by typing in coordinate and then use the align top/left tool to get subsequent LEDs aligned to the grid. (But it is easy to get off grid that way)

author: mengfei
author_rank: Regular Contributor
timestamp: January 21, 2025, 02:04:50 am
content: hmmm strangely I never used Grid to align my partsi just used the Align command. if they are equidistant, i just get the first & last footprint then Distribute Horiz or Vertwe just update from 24.3.* to 24.10.1 coz the later had a bug in the Paste Mask adjustments, that could also be a bug. try another version

author: thm_w
author_rank: Super Contributor
timestamp: January 21, 2025, 09:39:03 pm
content: Works OK for me. Try changing the colors of your custom grid so you can see if its actually where you need it.Also make sure the Extents is large enough for where you want it.Double click to edit it in the Grid Manager panel.

author: incf
author_rank: Frequent Contributor
timestamp: January 21, 2025, 10:25:23 pm
content: Quote from: thm_w on January 21, 2025, 09:39:03 pmIf I may ask, what version/build of Altium did you test it on? And what exactly did you do to test?Also, were you about to view the three images embedded in the original post? Your remark grid colors and extents makes me worry that the images might not be visible.The question is about about the aligning the origin of a part with an custom grid with an offset origin that does not align with the global grid (or some equivalent operation).

author: thm_w
author_rank: Super Contributor
timestamp: January 22, 2025, 12:12:40 am
content: Yes I can see the images.So you are saying the gray grid visible in the image is your custom grid? See why I ask to change the color, so its obvious which is global grid and which is your custom grid.Version is 25.1.2Quote from: incf on January 21, 2025, 10:25:23 pmYes that is what Origin setting is for.

author: incf
author_rank: Frequent Contributor
timestamp: January 22, 2025, 04:08:22 pm
content: Quote from: thm_w on January 22, 2025, 12:12:40 amYour remark about the origin settings makes me worry that could possibly be answering a different question that the one I wanted to find the answer to.Yes, the grey grid is the custom grid. It is the only one enabled, and the global grid is set to 100mmDid you try the "snap to grid" tool with large grid values like 100mm? (and the custom grid origin not aligned to the global grid)I worry there is a chance that I might be being misinterpreted.There are two originsthe origin of the custom grid - grid_originthe origin of the LED - led_originI want to set led_origin = grid_originWith grid_origin being some fixed value, and led_origin changing to match what the grid was set to previously.The snap to grid tool is supposed to move the part origin onto the custom grid, but instead it moves it into the inactive/disabled global grid.I don't see any way to move the LED onto the custom offset grid without manually editing the X/Y coordinates of at least one LED by hand.

author: incf
author_rank: Frequent Contributor
timestamp: January 22, 2025, 07:06:49 pm
content: I found a workaround for the "align to grid" tool apparently being broken (I would still like help understanding what is going wrong with that tool)The snap panel (which I totally neglect most of the time) can be configured to permit snapping to component origin. Then the "move" tool can be used to select the component by its origin and then (with the grid enabled) place its origin onto the current grid.(in the image below the "grids" button would be enabled, snapping set to all layers, and "objects for snapping" be set to "component origins" only)

author: thm_w
author_rank: Super Contributor
timestamp: January 22, 2025, 09:46:06 pm
content: Quote from: incf on January 22, 2025, 04:08:22 pmTried large values, works fine as expected. Custom grid not aligned is exactly what I showed in the screenshot.Quote from: incf on January 22, 2025, 07:06:49 pmYes the snap panel was shown in the first 5s of the video above.If you want to snap to part center, then you can use "Footprint origin" and make sure the origin of your LED footprint is in the center.If you didn't want that for some reason, you could add a cross or dot at part center on another notes/mechnical layer.