Page 1 of 1

[Solved] Adding multiple snap lines

Posted: Mon May 06, 2019 7:10 pm
by 3+4i
Is there a way to add multiple snap lines other than adding them one by one? It takes five clicks (plus entering a number) to add one. I need like several dozen of them, doing it that way would be quite a pain. The result of my Google-search was quite bleak, which usually isn't a good sign :( .

Adding them via macro doesn't even seem possible at all. That would have helped as well, since the snap lines I need follow a pattern, but it's not a simple one.

Re: adding multiple snap lines

Posted: Mon May 06, 2019 8:24 pm
by Lupp
There is a dispatcher command .uno:setSnapItem, but (as usual) I cannot find information about arguments. Called without arguments it simply opens the insertion dialog. Next problem: How access an inserted snapitem for editing.

Most likely won't pay for the needed research.

Re: Adding multiple snap lines

Posted: Tue May 07, 2019 8:50 am
by keme
"... not a simple [pattern]" suggests that adjusting the grid is also not an option. You could look into it anyway. Shouldn't take too long.
Menu item Tools - Options, expand branch Draw - Grid.

Did you know: You can drag snap lines out from the rulers. At worst one click saved per line, compared to using the Insert menu item. Right click for precise editing of position.
Manual precision may be sufficient, in which case you save a lot of clicks. :super:
Press the Alt key while dragging to toggle snap mode for positioning the line (smooth drag or snap to grid).

If you explain the desired snap pattern in more detail than "not simple", someone here may have suggestions for other workarounds.

Re: Adding multiple snap lines

Posted: Wed May 08, 2019 8:41 am
by 3+4i
keme wrote:"... not a simple [pattern]" suggests that adjusting the grid is also not an option.
That's exactly the reason why I wrote this. I already considered it, but I wasn't quite happy with changing a global setting for that. I really had hoped there would be an easier solution. It might still be possible with using the grid though, I'd just need to change it several times.
Did you know: You can drag snap lines out from the rulers.
I knew, but I honestly didn't even consider it. You're right though, it actually is faster indeed, I never would have guessed :o .
If you explain the desired snap pattern in more detail than "not simple", someone here may have suggestions for other workarounds.
The vertical lines are still fairly simple: I need one every 1.7 cm, but with a shift of 1 cm. I could use the margin to get the shift, then it would easily work with the grid. The interval changes somewhere in the middle of the page, since I have some wider shapes there, but I guess I could manually place snap lines there. After that, the pattern continues, just with a different shift.

For the horizontal lines I have alternating intervals, I haven't determined the precise values yet. The whole thing is a fairly large dependency tree, one of the lines is for the items, the other is for the labels in between, so I don't necessarily need both at the same time. That would reduce it to a single interval and I could use the grid again. Guess I'll try that then.

Re: Adding multiple snap lines

Posted: Wed May 08, 2019 9:08 am
by keme
You could also add a "Guides" layer where you draw lines for your custom snap grid.
  • There is the Modify - Distribution tool to distribute lines evenly.
    Draw your first line. Copy/paste the number you need. Position the first and last line and use the distribution tool.
  • After you have all your guide lines in place, edit layer properties, tick Locked and untick Printable.
    This makes your grid visible on screen, but you can't select lines and they won't print.
  • You can shift-click the layer tab to toggle visibility.
    Snap does not depend on visibility. Will snap to invisible objects.
  • If you use this, you may also want to make a "Guiding_lines" style where you set the line color and style for your entire grid.
    This way you can easily change the line appearance of your custom snap grid, so it doesn't visually interfere with your actual content. Makes it easier to work with if you have really complex diagrams.

Re: Adding multiple snap lines

Posted: Wed May 08, 2019 11:23 am
by Lupp
The proposition by keme seems to be the optimal advice to me. It is in addition fully elaborate.

I could only tell you that I once used draw a lot without even being aware of the snapitem feature. I used invisible lines -sometimes lines so faintly coloured that they weren't printed on my printers - for the purpose. You get the advantage that as-if snapitems of this kind can be grouped.

Re: Adding multiple snap lines

Posted: Sat May 11, 2019 10:12 am
by 3+4i
@keme: Thanks! I've been trying it out and it's exactly what I needed! It even seems more powerful than snap lines themselves, since it's more flexible: you can do anything you could with normal shapes, like changing appearance or having a snap line that only partially crosses the page.

I also found the option "Snap to Object Border" from the Options-toolbar, which actually makes things snap to the "snap"-shapes, though it's limited to the rectangular (?) frame of the shape and only works for all objects, which might not be desired when other close-by objects interfere. "Duplicate" from the Edit-menu also turned out super helpful.