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.

Copy and Move commands

Started by DCdosuser, July 31, 2010, 07:34:10 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

DCdosuser

I am a long time DesignCad Dos user.  I bought DC 3000 years ago but have not migrated to it because of difficulties with the copy and move commands.  Recently purchased DC 3D Max version 17 for Windows XP machine in hopes of being able to be able to open recent AutoCad drawings.  The problem with the copy (now called duplicate) and move commands does not seem to have improved.  I simply cannot figure out how to copy or move objects rotated from their original position and/or at a different size.  In DC dos it is easy.  I simply click on the move command icon in my custom menu,  highlight the objects I want to move, hit enter, click the two points on the original location, (I may have had to hit enter again), then click on the two points where the objects are to be moved.  The only issue was that I might have to change a setting for whether the object was to remain at the original size or not.  It was more than a few steps to change this setting.  However, in general the procedure was very simple and I could do it without even thinking about it. 

In 3D Max I realize that an object must be selected first.  This is counterintuitive because for most things the command is selected first. But regardless, here is how I have been trying to use the move command (duplicate is pretty much the same issue).  When I click M, then check the box for "from reference point", I gravity click on one point but there is no option to click on a second point before setting a point for the new location.  The objects move to the new location just fine, but they are always the same size and are un-rotated.  Moving in DC dos will rotate the objects when the points for the original location are not parallel to the two points for the new location.  The 3D Max manual indicates that I should be able to click up to 3 points for handles BEFORE selecting up to 3 points for the new location.  I have combed through all of the options and preferences tabs but cannot locate a setting for allowing the use of more than one point for original or new location.

Help would be much appreciated.  Hopefully the solution is something simple.  These commands are needed often, and my wish is that they be performed in a minimal number of keystrokes.  Thanks in advance.

Bob P

Try this...

Select your object.
Set two or more handles with Ctrl-h (Enter to finish)
Snap to your primary handle (without setting a point)
Duplicate command (N)
Uncheck the "Use original scale" box.
Set your new points.

Lar

To elaborate on Bob P's instructions:

Select the entity first, which would generate the 'Big Blue' (my personal name for it) Selection Handle whose location would depend on how you made the selection: if you clicked then the handle comes where you click... if you drag-select then big blue appears at the center of the selection box. To simply move the selection (without resizing/rotating) you can just click on big blue (the cursor changes to a 4-point arrow), or press the M key, which will pick up the selection and where you next click is where the selection will be moved to. To do a simple duplication press N or ctrl+click on big blue and where you next click is where your copy will be located.

To rotate/resize a selection you must have at least 2 handles (max of 2 in 2d mode and 3 in 3d mode - if setting less than the max press enter to finish the command). To do this press ctrl+h (or Edit menu> Selection Edit> Set Handles) then set the required points for your handles. Big blue will appear at the first click and blue outlined circles with '1' and '2' will appear at the other 2 points. To move and rotate the selection you can now press M or click on big blue, then set up to three points to describe how you want the selection rotated. The selection will move to the first point and will be rotated so that the 2nd click relates to how handle '1' (the second handle) relates to big blue in the original orientation. If 'Use Original Scale' is checked in the move dialog box then dcad only uses the direction of the 2nd click and rotates the selection without resizing it (so you can, for example, snap to an existing point or line any where along that direction). If 'use original scale' is unchecked then the selection will be scaled in proportion to the distance between the 1st and 2nd handle and the 1st and 2nd points clicked. The above works the same for duplicating the selection.

You can set less than the full amount of handles then press enter to finish the command.

If you activate 'use Sticky Handles' (General tab of the Options Dialog box ['Q' key]) the handles you set 'sticks' with the objects (only works on a single entity or a defined Group or Solid). So if you select it again the handles are there for you. In this case the 1st handle appears as a blue outlined circle with a '0' in it. Big blue still appears as described in the top paragraph but it is a separate handle system from the sticky handles.

Some commands automatically uses the sticky handles (like move, duplicate, ctrl+c copy and paste) and some use big blue (like mirror, rotate and the various rescaling commands). If you issue the command via the menu or hot keys the automatic handle is used. Otherwise you can click on either handle '0' or big blue to use that handle for move. If you ctrl+click on either of those handles the duplicate command will be activated.

The advantage of selecting first is that you can do another command on the same selection without going through those irritating repetitive command steps over and over like how acad works. So, for example you can make a selection, press 'M' to move it, press 'N' to duplicate it, press '/' to mirror it, press ctrl+c to copy it to the clipboard, select something else, do as many commands as you want on that, press ctrl+p (select previous) to re-select the first selection and do whatever to want again. A selection remains selected until to either select something else or press Esc to de-select it, so you can create some other stuff.

The advantage of using shortcut keys is that the selection doesn't have to be visible onscreen to work a command on it. Just press the key and a preview of the selection will appear at the cursor, ready for you to complete the command (or press esc to abort).

Lar


DCdosuser

Thanks guys.  I will give this a try.

DCdosuser

Thanks again.  I am now able to move and copy at a fixed scale or resized.  My problem was that when I tried to uncheck the "use original scale" box I couldn't do it because it was grayed out, even though there was a check in the box.  I finally figured out that I needed to uncheck the "from reference point" box FIRST.  Then the other option was no longer grayed out, and I could uncheck it.

Moving and copying in 3D Max still seems to me to be a tedious process and it will take me a long time to unlearn the dos method, which was very straightforward.  If anyone has a macro that allows the copying and moving of objects with mostly mouse clicks, I would love to have it.

In spite of my misgivings, I thank both Bob P and Lar for their solution.  It has made the software usable now.

Bob P

Unfortunately, I can't give proper credit to whomever wrote this...
Note that the 5th point is merely equivalent to "do it!".
' M.d3m DC6 style Move macro for 2 or 4 point moves.
'
' Select object; run macro.
' For 2 point moves, set 2 points, then hit Enter key.
' For 4 point moves, set 4 points, then set a fifth point or hit enter.
' (This allows you to check your work before committing to the move)
'
' Also works in preset point mode
'
' Note that sys(36) prevents dialog box cleanup errors.
' Sys(1)=0 does not clean up set points in preset point mode.

If Sys(80) < 1 Then
message "4-Point Move. No entities selected"
End
endif

Sys(41) = 0
dim x(6),y(6), z(6)
n=sys(1)

if n> 4 then n=4
if (n=2) or (n=4) then goto gottem 'use correctly set points

retry:
if n>0 then message "Retry. Set 2 or 5 points" 'Optional
setpoint "Duplicate (Set 5 pts or Set 2pts + Enter)" 5 '5th point allows redo of 4th
n=sys(1)
if n>4 then n=4
if (n=1) or (n=3) then goto retry ' Optional n=3
if n=0 then goto cleanup

gottem:

sflag=sys(36)
sys(36)=1

for i=1 to n
pointval x(i) y(i) z(i) i
next i
sys(1)=0
if n=2 then

>SetHandle
{
<Pointxyz [x(1), y(1), z(1)]
}

>Move
{
<Type 1 ' Rotated but not scaled
<Pointxyz [x(2), y(2), z(2)]
}

else

>SetHandle
{
<Pointxyz [x(1), y(1), z(1)]
<Pointxyz [x(2), y(2), z(2)]
}

>Move
{
<Type 1 ' Rotated but not scaled
<Pointxyz [x(3), y(3), z(3)]
<Pointxyz [x(4), y(4), z(4)]
}

endif

cleanup: 'vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

sys(36)=sflag
sys(1)=0 'clean up unused points
>deselect
{
' optionally emulates DC6 behavior
}
REGEN

' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ end Cleanup

DCdosuser

Bob P  -

I assume this is Basiccad.  I have no idea how to program in Basiccad. 

Dr PR

Just copy the text and paste into Notepad. Then save it with the name "M.d3m" in the macros folder. You can assign the macro to a keyboard key. The ".d3m" file type is a DesignCAD macro file. Here are the steps to assign a macro to a keyboard key:

1. Create a "Macros" folder.

The macro folder can be found and changed in the "Options/Options/File Locations" dialog. Look at the "Macro" entry. I recommend creating a different folder so that new installations will not overwrite anything. I have a "C:\DesignCAD\Macros" folder where I keep my macros.

When you have created your new macros folder location enter the path in the "Options/Options/File Locations/Macros" field.

2. Move your macros to the "Macros" folder.

You can execute a macro with the "Tools/Macro Execute" (%) function. A list of the macros in the Macros folder will open and you can select the macro to execute.

3. Create a custom keyboard definitions file.

In this case the macro is something you will want to execute from a single keystroke, just like any other command. You will need to save the new key definition in the "keyboard.dkf" keyboard definition file. Open "Options/Options/File Locations" and look at the "Custom Keyboard" entry. This tells where the default keyboard definition file is located.

Again, I recommend that you create a new location for your custom keyboard file so it will not be overwritten by future program installations. I keep my keyboard definition file in the "C:\DesignCAD" folder. Copy the original keyboard definition file to your new location and then enter the pathway into the "Options/Options/File Locations/Custom Keyboard" entry. Leave the original keyboard definition file where the installation left it so you will have it for backup in case something happens to your new file.

4. Assign the macro to a keyboard key.

To assign the macro to a key open the "Options/Options/Keyboard" dialog. In the "Categories" window look down for the macro entry and select it. The "Files" window will list all the macros in your Macros folder. Select the "M.d3m" macro file.

Now comes the hard part - what key do you want to assign the macro to? Be careful, it may already be used for some other function. You cannot override a function assigned in Windows like the copy and paste functions - these aren't DesignCAD code.

Open the drop down list in the "New Key" window and select the basic key. If you want it to work with the ALT, CTRL or SHIFT keys (or a combination) click the appropriate boxes.

Now click the "Save" button. A file window will open listing the files in the folder containing the "keyboard.dkf" keyboard definitions file. Select the file and click the "Save" button. Then click the "Apply" button.

Shut down DesignCAD. Many changes like this do not take effect until the program is closed and restarted. It is always a good idea to restart after making a configuration change.

Now when you start DesignCAD the new macro function will be available on the assigned key.

Note: Sometimes something in the system already used the key combinations you have picked and prevents DesignCAD key definitions from working - like CTRL C, CTRL X and CTRL V assignments in Windows. If your key assignment doesn't work try another key combination. This doesn't happen often, but it can be a source of confusion until you figure out what has happened.
DesignCAD user since 1987

DCdosuser

Bob P  -

I was able to get this to work.  My selected lines were moved and rotated as expected.  The interesting thing is that hitting enter after my first two points are selected is not the correct thing to do.  I am used to doing this in DC Dos (click on two points of the item to be moved, ENTER, click on two points for the new location, ENTER).  However, this works and saves a step in the process.  One of the things I had hoped for doesn't occur.  There is no pop-up message for a choice of retaining the original scale or allowing for re-scaling.  So it always is moved at the original scale.  Is there a way to have this option?

Even though the text of the macro seems to indicate that there are several possible messages, I never saw any.

I assume that a macro for Duplicate can be made by changing every instance of "Move" with "Duplicate", and naming the macro N.d3m.

bdeck

#9
Hi DCdosuser,

Current versions of the macro BobP posted (plus improved N and S macros ) are here:

http://forum.designcad.com/index.php?topic=322.msg1404#msg1404

If you are using v17.2 or earlier, you may want the current version of the macro in order to avoid the 180 deg rotation bug.

The bug fix causes strange undo behavior. ( predictable, not buggy. Simply requires extra undo keystrokes for 4-point moves or dups )

The n command does not do multiple copies as in the old dos version. That is done by the new array command.

QuoteI assume that a macro for Duplicate can be made by changing every instance of "Move" with "Duplicate", and naming the macro N.d3m.

In the old version, yes, I think that is correct. The newer versions are a bit more complex.

I prefer scale as a separate operation.

BD

bdeck

#10
Quote from: bdeck on August 09, 2010, 07:00:24 PM
I prefer scale as a separate operation.

Hello DCdosuser,

On second thought, here's a rewrite of the older version of the macro that allows rescaling during a 4-point move.

Good idea.

BD



' MS.d3m DC6 style Move macro to do 2 point moves or 4 point moves to combine rotation and optional scaling
' in a single move operation.   bdeck 8/2010
'
' Select object; run macro.
' For 2 point moves, set 2 points, then hit Enter key.
' For 4 point moves, set 4 points, then set a fifth point or hit enter.
' (This allows you to check your work before committing to the move)
'
' Also works in preset point mode
'
' Note that sys(36) prevents dialog box cleanup errors.
' Sys(1)=0 does not clean up set points in preset point mode.

If Sys(80) < 1 Then
message "4-Point Move. No entities selected"
End
endif

Sys(41) = 0
dim x(6),y(6), z(6)
n=sys(1)

if n> 4 then n=4
if (n=2) or (n=4) then goto gottem 'use correctly set points

retry:
if n>0 then message "Retry. Set 2 or 5 points" 'Optional
setpoint "Duplicate (Set 5 pts or Set 2pts + Enter)" 5 '5th point allows redo of 4th
n=sys(1)
if n>4 then n=4
if (n=1) or (n=3) then goto retry ' Optional n=3
if n=0 then goto cleanup

gottem:

sflag=sys(36)
sys(36)=1

for i=1 to n
pointval x(i) y(i) z(i) i
next i
sys(1)=0
if n=2 then

>SetHandle
{
<Pointxyz [x(1), y(1), z(1)]
}

>Move
{
<Type 1 ' Rotated but not scaled
<Pointxyz [x(2), y(2), z(2)]
}

else

input "Rescale?   1= rescale     default = same scale", tt$
t=1
if tt$= "1" then t=0
if tt$="y" then t=0
if tt$="Y" then t=0
if tt$="yes" then t=0
if tt$="Yes" then t=0
if tt$="YES" then t=0

>SetHandle
{
<Pointxyz [x(1), y(1), z(1)]
<Pointxyz [x(2), y(2), z(2)]
}


>Move
{
<Type [t] ' Rotated and scaled
<Pointxyz [x(3), y(3), z(3)]
<Pointxyz [x(4), y(4), z(4)]
}

endif

cleanup: 'vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

sys(36)=sflag
sys(1)=0 'clean up unused points
REGEN



DCdosuser

bdeck  -

This works great!

Now I would like to do a macro for Duplicate that works the same way.  I plan to try substituting N.d3m for M.d3m on the first line, and then substitute >Duplicate for >Move in two locations further down.  Do you think that will work (I have no skills in BasicCad programming)?

DCdosuser

dbeck  -

I shouldn't have posted so quickly.  I made the changes mentioned above in the macro you just posted.  This created a Duplicate macro, and it worked like a charm!  Now I have macros that flows better than the default commands for Move and Duplicate.  All I have to do is select the objects to move or copy, hit the key that the macro is assigned to, click on two original points, click on two points for the new location, hit ENTER, and fill in the box if the objects need to be re-scaled, or just hit ENTER again if not.  Thanks millions!

-  DCdosuser

Lar

To each his own, I guess.

The default move command can be initiated and executed in less than a half second when you get comfortable with it. Moving and rotating/scaling can take close to a second.

Without the macro all I have to do is select the objects to move or copy, hit the key for handles and click two points, click on  the first handle for Move (or ctrl+click for duplicate) and click two points for the new location and rotation. To scale by distance just uncheck 'original scale' in the dialog box anytime before setting the 2nd point (note that if you don't want to rotate/scale just set 1 point and press enter (the default shortcut for enter is the middle mouse button while in a command. If not in a command then it's for Pan).

While the default method may take 1 more click than the macro the advantage is that, with 'sticky handles' enabled, if you ever want to move and rotate that entity, or duplicates or mirrors of that entity, you can just select then pick up from the sticky handles. With the macro you would be constantly setting the 2 original points. Note that since the macro is actually setting these handles for you, when you select the entity the next time rather than calling up the macro just press M or click handle-0 (or N or ctrl+click for duplicate) then set the 2 last points.

Also, in 3d mode you are allowed up to 3 handles so you can rotate something in 3 planes (remember, you can use less than the amount of handles set by pressing enter).

The problem with designcad is that there are so many different ways to do one thing and so many options along the way that describing a technique fully takes so much explaining that it starts to look complicated when written down.

Lar

bdeck

#14
Hi Lar,

Of course you are correct. The default command is more capable than the macro. And it will always be there for those cases where its extra capabilities are needed.

But some folks, (DCdosuser and myself, for example) just cant get the hang of the new format. I'm an old dog, and that's an unnecessarily new trick.

As a rule, I use the no-handles macro for 2d work. In 3d even I need to slow down and set handles one at a time.

Quote... you can just select then pick up from the sticky handles ...

You are correct again. The macro should be improved to optionally recognize existing handles (sticky or not). And to do 6-point moves in 3D.

Good points.

Quote
..hit the key for handles ...

Sadly, there is no single  key to set handles.  

Again I would urge any new user (and IMSI) to change the keyboard shortcut from cntrl-H to simply H.

That will take a little of the hassle out of using handles.


Regards

BD