DesignCAD 3D Max 2027 box
Now available

DesignCAD 2027

Hatches that follow their boundaries, an on-screen dial to turn your model, and a way to find any command by name, in a clean Windows 11 look.

create a point on a line

Started by windsor2, October 29, 2007, 08:42:23 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

windsor2

Hi all,
Is there a way to create a point at a specific distance on a line? I have tried the tick marks command but it won't do what I want. I would like to be able to set a point mark a specific distance on a line or arc etc. Example: I have a line thats 20 inches long and would like to set a point at 4 3/4 inches from one end. I have design cad 3d max ver 17.2.

Thanks,
Mike

Rob S


1) For a quick solution, I sometimes draw a circle of the specified radius with its centre on the endpoint of the line.

That will give you an intersection you can snap to.

2) You can also draw a perpendicular from the line at its endpoint, and then parallel it by the desired distance.

3) In DCAD 17, you can in fact use the tickmark command to do this on a line.  If the first line of the tickmark dialog says "section", click "change" at the bottom so it says "distance".  Enter the desired distance in the top box, and click on the line and then beside it. 

If it starts from the wrong end, select the line, and click on the reverse points double arrow icon in the info box.
User since forever

impulse

You might look at implementing one of the POINT CONTROL ("j" key) commands into your stream of commands. In particular, the POINT at a FIXED DISTANCE/CUSTOM DISTANCE. You still wind up with an entity to be deleted though.
There was also a macro submitted on the Upperspace forum with this very topic. I believe it was written for DCAD dos by Bob P. and then other members PRL? massaged it to useability for later versions.
>impulse

prl

Rob's method is the gold standard but Impulse is right, we did do this before, a long long time ago.  Here you go. 



Quoteprl on 07/31/2003 10:03:05 AM

This is for Bob P,

Here is my version of your bsc program. It accepts negative distances to indicate the line is to extend in the 180 degree direction.


' Program: v2.d3m
' this program draws a line with a specific distance.

' based on cartesian vector algebra
' point 1 defines the starting point of the line
' point 2 defines the unit direction vector (line direction)
' a positive length draws line from point 1 in direction of point 2
' a negative length draws line in opposite direction

' created for dc version 13

precision 15

npts = sys(1)

if npts <> 2 then
sys(1)=0
setpoint "set line points: 1) starting position, 2) direction ", 2
end if

pointval cx cy cz 1
pointval ex2 ey2 ez2 2

sys(1)=0
dx = ex2 - cx
dy = ey2 - cy
dz = ez2 - cz
d = dx * dx + dy * dy + dz * dz

if d = 0 then
message "error: 1st and 2nd points are identical, unable to determine unit direction vector."
end
end if

d = sqrt(d)

'unit vector
di=dx/d
dj=dy/d
dk=dz/d

input "enter magnitude (length) of the line: ", rz$
r=val(rz$)

if r = 0 then
message "error: no line length input provided."
end
end if

'direction vector components
rx = r*di
ry = r*dj
rz = r*dk

x2 = cx + rx
y2 = cy + ry
z2 = cz + rz

>line
{
<pointxyz [cx, cy, cz]
<pointxyz [x2, y2, z2]
}

>redraw
{
}
end


windsor2

Thanks to all for the help. I now have several great ways to do what I want
Mike

Lar

Here's the 'least-mouse-click' way (easy for horizontal and vertical lines only. Angled lines require 1 or 2 more clicks using Point Polar command with the Coordinate Bar to get the angle, but may be easier using the Rob's circle method).

Point Select Mode is on...

For horizontal and vertical lines:
   click-1: click on the line to select it,
   click-2: click anywhere on the line between the existing points where you want the new point to be set. This will pickup a ghost point that you can move around...
   almost-a-click,3: move the mouse with the ghost point close to the point you want to measure from and use the comma key to snap there without setting a point...
   4: use the Point Relative command to move the mouse with the ghost point the necessary distance and direction. A new point will be set there.

Lar,
8) currently hunkering down for Tropical Storm Noel. Just some rain and li'l bit wind so far. Biggest problems are the grocery store and gas lines.