Page 1 of 1

How to lock objects so they can't be moved but still be able to align to them?

Posted: Sun Oct 01, 2017 10:47 am
by seans_potato_biz
I have some objects that I want to stay put but I still need to be able to align other objects to them. The problem is that if they're locked, I can't select them to align to them and if they're unlocked, they're susceptible to accidental movement.

Re: How to lock objects so they can't be moved but still be able to align to them?

Posted: Sun Oct 01, 2017 12:21 pm
by Moini
You can lock, unlock and select them via Objects dialog.

Re: How to lock objects so they can't be moved but still be able to align to them?

Posted: Sun Oct 01, 2017 12:21 pm
by Moini
(btw. we're at 0.92.2 now)

Re: How to lock objects so they can't be moved but still be able to align to them?

Posted: Sun Oct 01, 2017 2:11 pm
by seans_potato_biz
Unfortunately though, I have 105 of these objects that I will probably want to align to several times per piece and it's going to get really tedious unlocking and relocking them every time! Besides, unlocking them to align to them exposes them to the risk of me aligning in the wrong direction and moving the object that I want to be locked.

Image

Re: How to lock objects so they can't be moved but still be able to align to them?

Posted: Sun Oct 01, 2017 8:57 pm
by brynn
It sounds like you might be using Align and Distribute dialog? I've always found that dialog frustrating for exactly the problems you describe. If it would offer to align them all relative to one of the objects, that would be better (for me). But at least for the Distribute section, all of them move.

But anyway, if that's the case, you might want to consider a different workflow for alignment. For example, snapping to a guide or grid (or bounding boxes, for those keys which are all the same height, I assume).

Once you have all the keys in one row, snapped to the same guide or gridline or each other's bounding box corner, or whatever; then you could use Distribute to make the space between them equal. Something like that.

Re: How to lock objects so they can't be moved but still be able to align to them?

Posted: Sun Oct 01, 2017 10:17 pm
by tylerdurden
@ seans_potato_biz:

Are you trying to setup this file so that neophytes can easily customize... or will you be arranging the elements?

The latter being the easier to setup, of course.

Re: How to lock objects so they can't be moved but still be able to align to them?

Posted: Mon Oct 02, 2017 9:21 am
by Moini
You should be able to lock all objects at once (e.g. via a common layer for the affected objects - I just found that locking doesn't really work as expected via objects dialog, in its right-click menu). You do not need to unlock them to be able to align them, if you select them via objects dialog. For any mistakes, there's Ctrl+Z. Oh well, there's also an issue with multi-select in the objects dialog... wow... :-/ (the selection of objects changes unexpectedly when you add more...)

Distribute keeps the outermost elements in their position, it's not entirely correct to say 'all of them move'.

So, seems the suggested functionality is too buggy, sorry... :-/

Re: How to lock objects so they can't be moved but still be able to align to them?

Posted: Mon Oct 02, 2017 9:27 am
by Moini
Hah, I used Shift for multi-select, better use Ctrl, then it won't jump (or rather, select contiguous lists of objects).

Re: How to lock objects so they can't be moved but still be able to align to them?

Posted: Mon Oct 02, 2017 10:16 am
by tylerdurden
AIUI, the OP wants to align TO locked objects, which are harder to select.

I'd setup the document so each key has a code number and lock that layer. Select the desired key using search, then select the text to align to the key.

Image

Much harder to inadvertently bump the keys out of position.

Re: How to lock objects so they can't be moved but still be able to align to them?

Posted: Mon Oct 02, 2017 10:23 am
by Moini
They are hard to select if you can't find them in the objects dialog, yes - labelling them would be another option, if there are lots of objects. Then they'd also be easy to select in objects dialog. Searching will work, too, of course.

Re: How to lock objects so they can't be moved but still be able to align to them?

Posted: Mon Oct 02, 2017 12:48 pm
by seans_potato_biz
The file is provided by a company which prints custom computer keyboard keys. You are intended design your keys on top of the layout provided and then send the file back to them. I really don't want to go through each key to label it but that would be an ideal solution if the company did it before sending the file out to people.

Re: How to lock objects so they can't be moved but still be able to align to them?

Posted: Mon Oct 02, 2017 10:47 pm
by Moini
Or you could just make a separate layer where you make your designs, and then lock or unlock the other layer, and select with node tool instead of selection tool for aligning. You can't accidentally move things with the node tool.

Re: How to lock objects so they can't be moved but still be able to align to them?

Posted: Wed Oct 04, 2017 2:17 am
by Uktrunie
What I've done is create a new layer above the grey key grid and the black key borders and lock/unlock the entire layer when I wanted to select and align.
It doesn't hurt to have the key lettering on a single layer, btw.

Also once you aligned something vertically to a key, you can use that object, instead of the grid, to align the rest of the letters in that row.

"it works", not perfect but I've created several keyboards and didn't find anything better, unfortunately.

Re: How to lock objects so they can't be moved but still be able to align to them?

Posted: Wed Oct 04, 2017 3:30 am
by theozh
@seans_potato_biz, just for curiosity...
How does a typical align process look like?
I assume, since it's letters you are aligning to some font baseline? What about horizontal alignment?
I further assume it is not just a simple "align center on vertical axis" & "align center on horizontal axis" to the key outlines, but depending on the letter?
Do the keys have (at least partially) equidistant positions on the keyboard layout or can these be random every other time?
Are there any regular patterns which might be used to find a better process than always align letter by letter 105 times?
What I want to find out, whether instead of aligning all letters one by one, if not distributing some bunches of letters might also work to some extent?

Re: How to lock objects so they can't be moved but still be able to align to them?

Posted: Wed Oct 04, 2017 7:00 am
by tylerdurden
Here's a searchable keymap... In Inkscape, search only properties and include locked objects for the key number (e.g. x23) and the object will be selected.

https://dl.dropbox.com/s/jw95no1d93a0pe9/wasd-TD.svg
Image
updated 10/4/17, 11:46am EDT