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

Post questions on how to use or achieve an effect in Inkscape.
seans_potato_biz
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?

Postby seans_potato_biz » Sun Oct 01, 2017 10:47 am

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.

Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

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

Postby Moini » Sun Oct 01, 2017 12:21 pm

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)

Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

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

Postby Moini » Sun Oct 01, 2017 12:21 pm

(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)

seans_potato_biz
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?

Postby seans_potato_biz » Sun Oct 01, 2017 2:11 pm

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
Win 7/10, Inkscape 0.92.2

We don't inherit the Earth from our parents; we borrow it from our children.

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

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

Postby brynn » Sun Oct 01, 2017 8:57 pm

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.

tylerdurden
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?

Postby tylerdurden » Sun Oct 01, 2017 10:17 pm

@ 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.
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/

Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

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

Postby Moini » Mon Oct 02, 2017 9:21 am

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... :-/
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)

Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

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

Postby Moini » Mon Oct 02, 2017 9:27 am

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)

tylerdurden
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?

Postby tylerdurden » Mon Oct 02, 2017 10:16 am

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.
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/

Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

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

Postby Moini » Mon Oct 02, 2017 10:23 am

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)

seans_potato_biz
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?

Postby seans_potato_biz » Mon Oct 02, 2017 12:48 pm

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.

Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

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

Postby Moini » Mon Oct 02, 2017 10:47 pm

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)

Uktrunie
Posts: 154
Joined: Sun Jul 18, 2010 4:48 am

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

Postby Uktrunie » Wed Oct 04, 2017 2:17 am

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.

theozh
Posts: 437
Joined: Fri Mar 23, 2012 6:30 pm

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

Postby theozh » Wed Oct 04, 2017 3:30 am

@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?
Win7/64, Inkscape 0.92.2

tylerdurden
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?

Postby tylerdurden » Wed Oct 04, 2017 7:00 am

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
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/


Return to “Help with using Inkscape”