News:

Please note new Forum URL: forum.designcad.com

Main Menu
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.

Extending a line

Started by MarkX, September 06, 2011, 12:56:41 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

MarkX

A common situation is to have a non-orthogonal line that you want to stretch to a particular length.

You can use the Information box to change the length of the line, but when you do it extends out in both directions.

What I would like is to cause the line to increase, but starting at one end of the line. This is possible in some other programs.

So far, the best I can figure is to put a marker (pointer) on the end of the line. Then change the length of the line. Then snap to the end of the line, and move it to the marker you set previously. Another approach would be to duplicate the line in place before extending it, so that the original end could still be snapped.

Is there a standard way or tool to handle this?

Thanks!
Mark

Rob S

Select it by the fixed end, using gravity snap, or select some other way, and set the handle at the fixed end.

Bring up the info box, and check the box marked "Use Select Handle"

Type in the desired length and press enter.

Viola!
User since forever

Pearco

Mark / Rob;

Thanks for the good question and answer. After trying it, I found it also works for shortening the line. I always played hit and miss with the extend command.
Jim
User since ProDesign 1.5

MarkX


DrollTroll

This is not exactly what you were asking for, but:

If you want to just lengthen or shorten a line segment arbitrarily (perhaps far enough that you can conveniently trim it to another line or circle/arc) you can select the line, and switch to Point Select Mode. Hold down the Shift key and move near the end point that you want to extend. When the cursor acquires an ellipsis (...) at its endpoint, click/release, then drag the endpoint where you want it. 
25 years with DesignCAD

MarkX

Hi DT,

That's cool too! Though it seems like for that to work, you have to select the line by some arbitrary point in the middle -- if you select the end, it always wants to move the entire line.

Thanks!
Mark

DrollTroll

True, you have to be careful not to select it at the point you want to extend.
25 years with DesignCAD

bdeck

Hi Mark,

To do what you want I normally just draw a circle of the desired radius centered on one end of the line, then trim the line to the circle, and erase the circle.

If you want to select an entity, without the handles getting in the way, use the S macro from here:

http://forum.designcad.com/index.php?topic=322.0

It is similar to the old select function from DC 6, and has some other improvements as well.

BD

JJG

#8
Quote from: DrollTroll on September 07, 2011, 10:11:00 AM
This is not exactly what you were asking for, but:

If you want to just lengthen or shorten a line segment arbitrarily (perhaps far enough that you can conveniently trim it to another line or circle/arc) you can select the line, and switch to Point Select Mode. Hold down the Shift key and move near the end point that you want to extend. When the cursor acquires an ellipsis (...) at its endpoint, click/release, then drag the endpoint where you want it.  

There is the "Extend" feature too, specifically dedicated for this kind of job ... ( Am I wrong ?)  found in Menu: Edit / Trim/Extend / Extend , accessible directly via "_" shortcut too (at least in the french version of Designcad).

see please explanations below

I just add the following remark , consisting in that just click "about" next to the line, anywhere, and it works.
During it, one can even use snap-tools such as thoses for intersection (F4 or Shift-F4) to adjust the line with the some objects (elllipses, etc ...) for which the functions of Trimming do not work.

MarkX

Quote from: JJG on September 08, 2011, 12:13:18 PM

There is the "Extend" feature too, specifically dedicated for this kind of job ... ( Am I wrong ?)  found in Menu: Edit / Trim/Extend / Extend , accessible directly via "_" shortcut too (at least in the french version of Designcad).
Actually, for both of these techniques, the problem is that I wanted to lengthen the line out a particular distance -- with nothing to snap to. If the extend tool had a "length" option than that would be great.

Thanks!
Mark

MarkX

Quote from: bdeck on September 07, 2011, 05:49:21 PM
Hi Mark,

To do what you want I normally just draw a circle of the desired radius centered on one end of the line, then trim the line to the circle, and erase the circle.

If you want to select an entity, without the handles getting in the way, use the S macro from here:

http://forum.designcad.com/index.php?topic=322.0

It is similar to the old select function from DC 6, and has some other improvements as well.

BD
Thanks BD! Another way to do this,  though it may take as many clicks as my first solution might. I'll have to look at the S macro. I'm not sure I understand what the issue with the handles are.

Thanks!
Mark

Bob P

I never did "translate" this old DOS macro to the new format.  It will set a point in the direction of two set points.  If we can get it to work within a DC command, you can use it to extend a line (with pointmove) or even extend a plane's vertex without destroying its "plane-ness". 

'Point Extend
'USE [] ONLY ONCE FOR PXYZ [ X,Y,X ]
'This sets a point on a line a given distance from a point. 
'You can use a negative value to go in the opposite direction.

DIM PTX(10), PTY(10), PTZ(10)    'Creates an array to store current point positions
NUM=SYS(1)         'Records the numbers of points already set
IF NUM=0 THEN GOTO DOIT
FOR J=1 TO NUM     'Record each point into PTX(N), PTY(N), PTZ(N)
POINTVAL PTX(J) PTY(J) PTZ(J) J
NEXT J
SYS(1) = 0
DOIT:
SETPOINT "Set a base point " 1
POINTVAL XV YV ZV 1
SYS(1)=0
SETPOINT "Set a point to extend FROM " 1
POINTVAL XEX YEX ZEX 1
SYS(1)=0
INPUT "How far from second point? " NEWD
DX=ABS(XV-XEX)
DY=ABS(YV-YEX)
DZ=ABS(ZV-ZEX)
DIST=(DX^2+DY^2+DZ^2)^.5
R=NEWD/DIST                           
XN=XEX+R*(XEX-XV)
YN=YEX+R*(YEX-YV)
ZN=ZEX+R*(ZEX-ZV)
SYS(1)=0             
FOR J=1 TO NUM      'Restores all the original points
>POINTXYZ [PTX(J), PTY(J), PTZ(J)]
NEXT J
>POINTXYZ [XN,YN,ZN]
END:

bdeck

Quote from: MarkX on September 10, 2011, 09:45:14 AM
Thanks BD! Another way to do this,  though it may take as many clicks as my first solution might. I'll have to look at the S macro. I'm not sure I understand what the issue with the handles are.

Actually the method by Rob S is about the same number of clicks. But for setting handles and bringing up the info box, I find it works better to first  change the keyboard shortcuts to and unshifted "h" and an unshifted "i" to make things go a bit faster. (at options/options/keyboard)

As BobP pointed out, my method works only in a 2D plane. Design cad does not have an equivalent sphere command.

BD

MarkX

Hello Bob,
Quote from: Bob P on September 10, 2011, 01:16:10 PM
I never did "translate" this old DOS macro to the new format.  It will set a point in the direction of two set points.  If we can get it to work within a DC command, you can use it to extend a line (with pointmove) or even extend a plane's vertex without destroying its "plane-ness". 
Since I don't know what the original macro was supposed to do exactly, I'm not sure if this code is working OK. But it does put a cursor out the right distance from a given line. There's a lot of code in there that's supposed to save points before and after the process, but I don't know what points the code is targeting -- handles, maybe? That part of the code didn't seem to really be doing anything when I checked the point count. I think I could modify this to do the line extend thing, but with all these other ideas, I'm not sure its necessary. I ended up placing the cursor at the end instead of a point, since the point-setting statements didn't seem to do anything unless accompanied by some action (like drawing a line).

Mark



'Point Extend
'USE [] ONLY ONCE FOR PXYZ [ X,Y,X ]
'This sets a point on a line a given distance from a point. 
'You can use a negative value to go in the opposite direction.

>SetStartPoint
{
<PointXYZ 0,0,0
  }
DIM PTX(10), PTY(10), PTZ(10)    'Creates an array to store current point positions
NUM=SYS(1)         'Records the numbers of points already set

IF NUM=0 THEN GOTO DOIT
FOR J=1 TO NUM     'Record each point into PTX(N), PTY(N), PTZ(N)
POINTVAL PTX(J), PTY(J), PTZ(J), J
NEXT J
SYS(1) = 0
DOIT:
SETPOINT "Set a base point " 1
POINTVAL XV, YV, ZV, 1
SYS(1)=0
SETPOINT "Set a point to extend FROM " 1
POINTVAL XEX, YEX, ZEX, 1
SYS(1)=0
INPUT "How far from second point? " NEWD
DX=ABS(XV-XEX)
DY=ABS(YV-YEX)
DZ=ABS(ZV-ZEX)
DIST=(DX^2+DY^2+DZ^2)^.5
R=NEWD/DIST                           
XN=XEX+R*(XEX-XV)
YN=YEX+R*(YEX-YV)
ZN=ZEX+R*(ZEX-ZV)
SYS(1)=0     

FOR J=1 TO NUM      'Restores all the original points
>PointSelect
{
<Type 0
<POINTXYZ [PTX(J), PTY(J), PTZ(J)]
}
'>POINTXYZ [PTX(J), PTY(J), PTZ(J)]
NEXT J
' Pointless comment here

'MESSAGE XN,YN,ZN," - ",XEX,YEX,ZEX
>MoveCursor
'>PointSelect
{
'<Type 0
<Pointxyz [XN, YN, ZN]
'<Pointxyz [XEX, YEX, ZEX]
'<Pointxyz 4.55, 4.158, 8.147
'<Pointxyz 4.55, 6.25, 3.60

}

END


Bob P

Thanks.  I'll have to try it out.

The reason I save previously set points is that in DC DOS, I almost always set the points before activating a command.  (Something I wish the Windows version allowed without having to invoke Preset Point Mode. - Just one extra, and unwanted step, IMHO...)

For instance (in DOS), I want to move a corner-point on a plane a given distance along the line of an edge.  I first set a point on the corner to be moved.  Then I invoke the macro.  It saves the first point.  Then I can snap to a point on the edge and snap to the first corner, then enter a value.  The macro then sets my original point and a second macro-derived point.  I can then invoke the Point-move command.

There are many other uses for the command, including drawing lines that extend out from edges, or trimming lines to a given length.  It's one of my most-used macros, in fact.