Macro to Set Orientation of Parallel by Distance

  • The flaw in the current parallel by distance command is that it doesn't use the second point to help define the plane for the copied line. The "Perpendicular From" does use the second point to define the plane, hence I use it to determine the correct offset points and then do a parallel command like you describe.

    Here's my routine for doing this.

    By: Pierre LaFlamme
'Program: para3d.d3m
'3d mode parallel by distance routine. Uses 2nd point to define plane
'version 14 and up

precision 15

' Get User Input
dx1$=sys$(0)
if dx1$ = "" then input "Enter distance to parallel: ", dx1$
dx=val(dx1$)

if sys(1) <> 2 then
sys(1)=0
setpoint "Point 1 on line, point 2 in direction of parallel (also defines plane) . . . " 2
endif
sys(36)=1

POINTVAL X1 Y1 Z1 1
POINTVAL X2 Y2 Z2 2

SYS(1)=0

>PerpendicularFrom
{
<SelectOnly 0
<pointxyz [X1, Y1, Z1]
<pointxyz [X2, Y2, Z2]
<Length [dx]
}

Entity Sys(9) ' Get the points for the line just drawn.

' only need the last two points
tp=sys(1)
tpm1=tp-1
Pointval x1 y1 z1 tpm1
Pointval x2 y2 z2 tp
sys(1)=0

>EraseLast 'remove the perpendicular line
{
}

>Parallel
{
<pointxyz [X1, Y1, Z1]
<pointxyz [X2, Y2, Z2]
}
End

Files to Download:

para3d.zip