@DougE Yes, I would like to select modules by script and then move/manipulate the block using the UI (i.e. I still want to use the UI for working on the layout).
Often I find myself in a situation where I’d like to move around a group of objects coherently, but the need to select every object single handedly whenever I loose the selection really bothers me. PcbNew does not have a “group” feature, so I figured defining groups via script and recall them would be the easiest approach (much like CTRL+Number lets you define/recall groups of units in mainstream strategy games).
The point is, nothing I do from the scripting interface seems to have a direct effect on the UI. If you change the position of an object for example you need to click around a bit until the UI actually picks up the change and draws the new position.
@mmccoo You mentioned a redraw or update command for the UI? Maybe a module.SetSelected() followed by ui.redraw/update() will do the trick?
I checked, @davidsrsb took care of that and as far as I can see he didn’t agree with the @system flagging him for spamming.
The system is just a little bit more careful with new users as @mmccoo joined on 17.2.2017, so he fell into the raster as basic user it seems… don’t know when he’ll get member status, there are a couple of tiny hurdles to jump over for:
@mmccoo Unfortunately the Refresh command doesn’t do the trick for me. There is probably another mechanism involved in the selection handling of objects in pcbnew.
I did check out the Zoom function just for fun. It only works for the classic view though, not with the OpenGL canvas enabled. I liked your post on adding such functionality yourself and found your git commit. It’s a nice entry point for someone without knowledge of the code! What I get from this is that PCB_EDIT_FRAME seems to handle two different canvas objects (GetCanvas, GetGalCanvas, IsGalCanvasActive). This is probably why there is kind of a break in functionality between the different views in pcbview.
It’s been a while since I’ve posted to this thread. I’ve added a new blog post, this time about applying the placement from the schematic to the layout. This helps get an initial placement that isn’t random.
One question for everyone: when posting about new blog posts, should I continue this thread or start a new one?
Personally, even though I go for long periods without working on this stuff, I like coming back to one place to see if anyone has asked a question. Better late than never? There aren’t a lot of people out there that are comfortable with the kicad code base.
I’ve added this thread to the FAQ. Please consider editing the original post from time to time if you feel that something could be added that would keep someone from having to read the entire thread.
@MitjaN yes,the replicate script does work with hierarchical schematics. The trick is whether to look for replication on the lower levels of hierarchy or the upper ones. I wish pcbnew supported properties. After I did my placement by sch script, I think I might be able to fake the properties thing by just parsing the schematics. Among other things, that would be a good place to store the desired spacings from one copy to the next. It would further make things clearer because it would also say which level is replicated. Send me a link to a testcase and I can take a look if it’s still relevant.
@hermit It appears I can’t edit my earlier posts. I don’t see the pencil icon on posts older than 40 days.
New post on zones with holes from svg
In other news, I have a new blog post. It’s about a script (and the hows behind it) that takes an svg file (only inkscape tested) and converts it to zones like this: