kicad_component_layout icon indicating copy to clipboard operation
kicad_component_layout copied to clipboard

Plugin is using page origin and not grid/aux origin

Open Riesi opened this issue 2 years ago • 1 comments

It seems like this tool uses the page origin and not one of the origins the user can set. This makes it hard to have a PCB thats properly placed on the sheet when using this plugin.

I currently fixed this locally, but I am not sure how the version checking works. I am on 6.0.11 and it seems to pick the wxPoint path, even though the comment says that newer should use Vector2I.

https://github.com/mcbridejc/kicad_component_layout/blob/master/component_layout_plugin.py#L152

grid_origin = pcb.GetDesignSettings().GetGridOrigin()

## Latest needs a pcbnew.VECTOR2I, 6.0.1 needs wxPoint
if use_vector2:
    mod.SetPosition(pcbnew.VECTOR2I_MM(x0 + x, y0 + y))
else:
    mod.SetPosition(pcbnew.wxPointMM(x0 + x, y0 + y)+grid_origin)

Kind regards, Riesi

Riesi avatar Feb 17 '23 08:02 Riesi

Ok so I guess the 6.99 check is for the KiCAD dev version for 7.0, which got released a few days ago. I will come back with a PR when I get 7.0 on my distro!

Riesi avatar Feb 17 '23 08:02 Riesi