# Snapping to Temp Lines

**URL:** <https://forums.sketchup.com/t/snapping-to-temp-lines/68203>\
**Category:** Ruby API\
**Created:** [May 9, 2018, 9:35pm UTC](https://forums.sketchup.com/t/snapping-to-temp-lines/68203 "2018-05-09T21:35:41Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![medeek](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/medeek/32/10675_2.png) [@medeek](https://forums.sketchup.com/u/medeek)\
**Post date:** [May 9, 2018, 9:35pm UTC](https://forums.sketchup.com/t/snapping-to-temp-lines/68203/1 "2018-05-09T21:35:41Z")

</div>

I would like to create a grid along the length of my wall (temporary) with the GL and draw method within my move opening tool.

However, after creating some temporary lines I just realized that the cursor will not snap to these lines or inference from them.

 ![](https://global.discourse-cdn.com/sketchup/original/3X/6/4/64b39b3c72b8179a43817b088b11a63d0fe0c925.jpeg)  
Has anyone else confronted this same situation and what is the the best solution?

I’m still pretty green when it comes to the SketchUp Tool class so I am probably missing something here.

What would be the best way to create some grid lines that the user could snap to?

---

<div class="post-metadata">

**Author:** ![eneroth3](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/eneroth3/32/1222_2.png) [@eneroth3](https://forums.sketchup.com/u/eneroth3)\
**Post date:** [May 9, 2018, 9:39pm UTC](https://forums.sketchup.com/t/snapping-to-temp-lines/68203/2 "2018-05-09T21:39:28Z")

</div>

I’ve tried making some custom snapping but it is quite messy as the API wasn’t designed for it.

You can check out the source code of my [3D Rotate Tool](https://extensions.sketchup.com/en/content/eneroth-3d-rotate-tool). Be prepared for messy code though as this was my first ever tool.

---

<div class="post-metadata">

**Author:** ![DanRathbun](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/danrathbun/32/500_2.png) [@DanRathbun](https://forums.sketchup.com/u/DanRathbun)\
**Post date:** [May 9, 2018, 9:44pm UTC](https://forums.sketchup.com/t/snapping-to-temp-lines/68203/3 "2018-05-09T21:44:12Z")

</div>

> [@medeek](#):
>
> What would be the best way to create some grid lines that the user could snap to?

Put temporary cpoints at the intersections of the GL grid, … or just use a temporary grid of clines.

See Trimble example code here … [Extension | SketchUp Extension Warehouse](http://extensions.sketchup.com/en/content/grid-tool)

---

<div class="post-metadata">

**Author:** ![medeek](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/medeek/32/10675_2.png) [@medeek](https://forums.sketchup.com/u/medeek)\
**Post date:** [May 10, 2018, 2:10am UTC](https://forums.sketchup.com/t/snapping-to-temp-lines/68203/4 "2018-05-10T02:10:16Z")

</div>

I put clines in a group then delete it once the move distance is determined, seems to work reasonably well.

---

<div class="post-metadata">

**Author:** ![medeek](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/medeek/32/10675_2.png) [@medeek](https://forums.sketchup.com/u/medeek)\
**Post date:** [May 10, 2018, 4:47pm UTC](https://forums.sketchup.com/t/snapping-to-temp-lines/68203/5 "2018-05-10T16:47:08Z")

</div>

The only problem with creating actually geometry is that the SketchUp undo function now has this geometry added so it messes up my system slightly. Is there a way to purge certain actions from the undo function

---

<div class="post-metadata">

**Author:** ![medeek](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/medeek/32/10675_2.png) [@medeek](https://forums.sketchup.com/u/medeek)\
**Post date:** [May 10, 2018, 6:31pm UTC](https://forums.sketchup.com/t/snapping-to-temp-lines/68203/6 "2018-05-10T18:31:48Z")

</div>

So that they don’t appear?

---

<div class="post-metadata">

**Author:** ![DanRathbun](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/danrathbun/32/500_2.png) [@DanRathbun](https://forums.sketchup.com/u/DanRathbun)\
**Post date:** [May 10, 2018, 6:35pm UTC](https://forums.sketchup.com/t/snapping-to-temp-lines/68203/7 "2018-05-10T18:35:47Z")

</div>

> [@medeek](#):
>
> Is there a way to purge certain actions from the undo function … So that they don’t appear?

There is no current access (at all) to the undo / redo stack.

The best you can do is use the transparent boolean arguments to [`Sketchup::Model#start_operation()`](http://ruby.sketchup.com/Sketchup/Model.html#start_operation-instance_method).

---

<div class="post-metadata">

**Author:** ![medeek](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/medeek/32/10675_2.png) [@medeek](https://forums.sketchup.com/u/medeek)\
**Post date:** [May 10, 2018, 9:06pm UTC](https://forums.sketchup.com/t/snapping-to-temp-lines/68203/8 "2018-05-10T21:06:57Z")

</div>

The transparent thing is just a mess.

I guess I’ll just have to forego the grid lines even though it would be really nice to have.

---

<div class="post-metadata">

**Author:** ![DanRathbun](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/danrathbun/32/500_2.png) [@DanRathbun](https://forums.sketchup.com/u/DanRathbun)\
**Post date:** [May 10, 2018, 9:09pm UTC](https://forums.sketchup.com/t/snapping-to-temp-lines/68203/9 "2018-05-10T21:09:16Z")

</div>

Well you could temporarily set the snapping in Units options.

---

<div class="post-metadata">

**Author:** ![medeek](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/medeek/32/10675_2.png) [@medeek](https://forums.sketchup.com/u/medeek)\
**Post date:** [May 10, 2018, 9:28pm UTC](https://forums.sketchup.com/t/snapping-to-temp-lines/68203/10 "2018-05-10T21:28:13Z")

</div>

Yes, but if the wall is not orthogonal to the global axis system than the snapping really doesn’t work.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/sketchup/original/3X/f/2/f2a121500b085ed60806607a82720b092d800bb3.png) [@system](https://forums.sketchup.com/u/system)\
**Post date:** [August 10, 2018, 1:28pm UTC](https://forums.sketchup.com/t/snapping-to-temp-lines/68203/11 "2018-08-10T13:28:19Z")

</div>

Closed on August 10, 2018, 1:28pm UTC

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.
