How to lock objects so they can't be moved but still be able to align to them?
-
- Posts: 138
- Joined: Mon Apr 07, 2008 6:01 am
How to lock objects so they can't be moved but still be able to align to them?
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.
Win 7/10, Inkscape 0.92.2
We don't inherit the Earth from our parents; we borrow it from our children.
We don't inherit the Earth from our parents; we borrow it from our children.
Re: How to lock objects so they can't be moved but still be able to align to them?
You can lock, unlock and select them via Objects dialog.
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!
Inkscape FAQ - Learning Resources - Website with tutorials (German and English)
Inkscape FAQ - Learning Resources - Website with tutorials (German and English)
Re: How to lock objects so they can't be moved but still be able to align to them?
(btw. we're at 0.92.2 now)
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!
Inkscape FAQ - Learning Resources - Website with tutorials (German and English)
Inkscape FAQ - Learning Resources - Website with tutorials (German and English)
-
- Posts: 138
- Joined: Mon Apr 07, 2008 6:01 am
Re: How to lock objects so they can't be moved but still be able to align to them?
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.


Win 7/10, Inkscape 0.92.2
We don't inherit the Earth from our parents; we borrow it from our children.
We don't inherit the Earth from our parents; we borrow it from our children.
Re: How to lock objects so they can't be moved but still be able to align to them?
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.
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.
Basics - Help menu > Tutorials
Manual - Inkscape: Guide to a Vector Drawing Program
Inkscape Community - Inkscape FAQ - Gallery
Inkscape for Cutting Design
Manual - Inkscape: Guide to a Vector Drawing Program
Inkscape Community - Inkscape FAQ - Gallery
Inkscape for Cutting Design
-
- Posts: 2344
- Joined: Sun Apr 14, 2013 12:04 pm
- Location: Michigan, USA
Re: How to lock objects so they can't be moved but still be able to align to them?
@ 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.
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.
Have a nice day.
I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1
The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/
I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1
The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/
Re: How to lock objects so they can't be moved but still be able to align to them?
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... :-/
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... :-/
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!
Inkscape FAQ - Learning Resources - Website with tutorials (German and English)
Inkscape FAQ - Learning Resources - Website with tutorials (German and English)
Re: How to lock objects so they can't be moved but still be able to align to them?
Hah, I used Shift for multi-select, better use Ctrl, then it won't jump (or rather, select contiguous lists of objects).
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!
Inkscape FAQ - Learning Resources - Website with tutorials (German and English)
Inkscape FAQ - Learning Resources - Website with tutorials (German and English)
-
- Posts: 2344
- Joined: Sun Apr 14, 2013 12:04 pm
- Location: Michigan, USA
Re: How to lock objects so they can't be moved but still be able to align to them?
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.

Much harder to inadvertently bump the keys out of position.
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.

Much harder to inadvertently bump the keys out of position.
Last edited by tylerdurden on Mon Oct 02, 2017 12:07 pm, edited 1 time in total.
Have a nice day.
I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1
The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/
I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1
The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/
Re: How to lock objects so they can't be moved but still be able to align to them?
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.
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!
Inkscape FAQ - Learning Resources - Website with tutorials (German and English)
Inkscape FAQ - Learning Resources - Website with tutorials (German and English)
-
- Posts: 138
- Joined: Mon Apr 07, 2008 6:01 am
Re: How to lock objects so they can't be moved but still be able to align to them?
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.
Win 7/10, Inkscape 0.92.2
We don't inherit the Earth from our parents; we borrow it from our children.
We don't inherit the Earth from our parents; we borrow it from our children.
Re: How to lock objects so they can't be moved but still be able to align to them?
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.
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!
Inkscape FAQ - Learning Resources - Website with tutorials (German and English)
Inkscape FAQ - Learning Resources - Website with tutorials (German and English)
Re: How to lock objects so they can't be moved but still be able to align to them?
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.
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?
@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?
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?
Win7/64, Inkscape 0.92.2
-
- Posts: 2344
- Joined: Sun Apr 14, 2013 12:04 pm
- Location: Michigan, USA
Re: How to lock objects so they can't be moved but still be able to align to them?
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

updated 10/4/17, 11:46am EDT
https://dl.dropbox.com/s/jw95no1d93a0pe9/wasd-TD.svg
updated 10/4/17, 11:46am EDT
Have a nice day.
I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1
The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/
I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1
The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/