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.

Multiple Parallel Lines

Started by mr.chocice, September 06, 2012, 10:15:22 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

mr.chocice

On the old DC6 I could select "parallel", click on a line once, then click on a number of locations and get parallel lines at all of those locations without having to go back to the parallel command.  On DC21 I seem to have to go back to the parallel command each time I want to make a new parallel line, which is a bit tedious.  Is there some way I can get the same result that I got on DC6?

In passing I would say that the "trim multiple" command has been very useful, now I need a "parallel multiple"

Thanks.

magic

Hi Mr. Choice,

All functions will stay active, if you double click the button, so double click the parallel line button, and it will keep paralleling.
It's a kind of magic!




Lar

#2
Magic, I don't think he wants the command to repeat... I think he wants the a single line to be paralleled multiple times without having to continuously click on the original line.

If this is the case, mr.chocice, below is a macro I wrote (or at least it was last updated) back in 1998 for just that purpose. You click on the original line then click points for the parallel.

Sorry there is no preview. This is probably because back in the DOS days dcad had the ability to click points first then you can call up the command. We users back then found this very nice. The macro is limited to 200 points.

If you want a preview you can modify the macro so that you set 2 points, both of which are memorized by the macro. You then call up the the parallel command and use the 2 points. You then repeatedly call up the command, letting the macro use the 1st memorized point and the user sets the 2nd point <<edit: the macro should memorize the previous point set by the user and use it with the 'move cursor' command to bring the cursor back to where the user last placed it>>. You will have to press esc or use the 'stop macro' command in the tools menu to end the macro.   

Lar


'Para.d3m, by Lar, March 1998

dim x(200), y(200), z(200)
message "Set 1 point at line to parallel then set parallel points..."
setpoint "Set 1 point at line to parallel then set parallel points..." 200
p=sys(1)
pointval x y z 1
for pp=2 to p
pointval x(pp) y(pp) z(pp) pp
next 'pp

for t=2 to p
>Parallel
{
  <PointXYZ [x, y, z]
  <PointXYZ [x(t), y(t), z(t)]
  }
next 't

JJG

#3
Quote from: Lar on September 06, 2012, 10:45:25 AM
Magic, I don't think he wants the command to repeat... I think he wants the a single line to be paralleled multiple times without having to continuously click on the original line.

Lar

Yes, good code.
Mr chocice could also use the array-command (found in "Draw/Array"), and use together the "Point relative/Reference Point" to set the distance : it's quick and easy to use !
the only concern is that it works good only for simple vector-lines, not for multiple vectors-lines, and not for circles, arcs or curves.

mr.chocice

Thanks for the thoughts.  Sorry to be slow here, but how do I take Lar's macro and load it into my system?  Can I then put an icon into my custom toolbox that will load the macro for me?

prl

#5
Quote from: mr.chocice on September 11, 2012, 12:03:07 PM
how do I take Lar's macro and load it into my system?  Can I then put an icon into my custom toolbox that will load the macro for me?

Yes.

First find out where your macro directory is.  Do this with the menu Options>Options>File Locations.  Place Lar's file in the directory for Macros.  Lar's file is a text file but ensure it is called Para.d3m.

Once you've done that, you can immediately access the command on the command line (hit the space bar) and type Para then hit the return key. 

To create a tool bar, go to Options>Options>Toolbox and under the Categories dropdown, select Macro and look for the Para.d3m. 

Have fun.

mr.chocice

Sorry, again.  I'm being really thick here, but please make allowances.  I found my Macro directory, but how do I place Lar's file in there. 

Thanks.

MarkX

Quote from: mr.chocice on September 19, 2012, 11:19:48 AM
Sorry, again.  I'm being really thick here, but please make allowances.  I found my Macro directory, but how do I place Lar's file in there. 

Thanks.
Lar posted the code, but didn't post it as a separate file. So you'll need to create the file and populate it yourself.

So you go to your macro directory in Window's explorer and right click. Select "New" and then text document. Give it a name like Para.txt. Double click on Para.txt to open it up (probably in notepad). Now go back to this forum thread and click on "Select" next to Lar's code. Then Copy the selection (Ctl-C). Then go back to notepad and paste the text. Save and close the file. Now right click on the file and select "Rename". Change the name of the file to match Lar's : Para.d3m

HTH
Mark

Lar

<<Mark posted ahead of me but I'll post anyway...>>
Just highlight the text of the macro from my post, press ctrl+C to copy it to the clipboard, open Notepad (or any word processor), paste it into the notepad file, save the file to your macros folder under any name you wish but with the .d3m extension. If using notepad you may have to click 'save as type' and select 'all files'.

To use the file use the 'macro execute' command from the tools menu (shortcut: %) or put it in a custom toolbox using the 'toolbox' tab in the Options dialog (shortcut: Q);

Lar

prl

Quote from: Lar on September 19, 2012, 04:29:38 PM
To use the file use the 'macro execute' command from the tools menu (shortcut: %) or put it in a custom toolbox using the 'toolbox' tab in the Options dialog (shortcut: Q);

Once you get the macro running, realize there are many ways you can access it. Depends on how you like to work.

1. Command line
2. % (macro execute)
3.  Custom toolbar button
4.  Your own hotkey for that command
5.  Custom menu item

Just so you know.