# Project to cplane with direction

Does anyone know how to project to cplane or basically move to height with constrained direction (tab)

Your second picture pretty well illustrates what I’d probably do:

• create a rectangular surface at the desired height above the plane big enough to surround the expected intersection spot.
• create my desired line to extend past the new surface
• trim the undesired part of the line with the surface.

Shouldn’t even take the mount of time I took to type this.

Or did I misinterpret what you want to do?

Yes, that is exactly what I was trying to do, but I wanted to accomplish that without drawing additional geometry.

I hoped that in Python there are more option to control direction of transformation.

Note that if you are simply moving geometry that is parallel to the current CPlane along a direction vector so that it lands on the CPlane, this is not really a projection. It will give the same result if all the geometry is parallel to the CPlane, but if not, a true projection operation will distort the geometry being projected as it’s “flattened” on the CPlane…

If this is simply a move operation of CPlane parallel geometry, that is pretty easy to script in Python with the input of, say, two points that determine the direction vector.

–Mitch

That is correct, it is not actually a projection, but rather move operation.

Do you think it is possible to create a python script which would also allow me to define length of such vector by selecting point on some cplane?

Well, if you’re just trying to move objects along a direction to be flat on the CPlane, you don’t need to specify a length, it can be automatically calculated once you have the direction. Basically using Rhinoscript methods, I would just create a line from your two points, attach the start point somewhere on your source object, then use LinePlaneIntersection to find the intersection of the line and the CPlane, then translate the object between the attach point and the CPlane intersect point. Done. (at least I think that’s what you want).

–Mitch

Yes, that’s what I am looking for, however I wanted to turn it into a ‘tool’ that can be used quickly in the future. Do you think it would be ‘handy’ enough to use later if I made a command out of it? I am concerned that it would only yield final result instead of giving real-time output, like Rhino does at the moment (it follows mouse cursor and shows object snapping to other objects).

Well, if you want dynamic display, that’s quite a bit more code than just a simple move script. But again, unless I misunderstood what you want, the moves are automatic - from the object’s current position to the CPlane, so I don’t know where the dynamic display comes in handy…

–Mitch

Exactly, that was the biggest issue from the start, because what I am really looking for is to change the way Rhino snaps to other objects while direction is locked - at the moment I can only use perpendicular snap while moving with locked direction, but what I need is to snap to cplane height.

Do you know by any chance if this behavior is possible to change with a script?

Sometimes a little temporary geometry is the most efficient way of accomplishing a task. Then just select it and delete when you’re done.

On the other hand, I understand full well the temptation to spend several hours devising a push-button tool just for the challenge.

Btw David Rutten had a good suggestion to simply use either front or right viewport to move direction-constrained object according to elevation. Still it would be interesting to know if with Python this could be also done in orthographic viewport.

Unfortunately I didn’t have enough experience in drafting cad software to know if this specific function has a name, but I thought it should be included in Rhino.