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.

Improved duplicate command

Started by JJG, January 14, 2009, 10:50:21 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

JJG

As user of Designcad since a long time, i was ever worry with the fact that the command "Duplicate" (shortcut key "N") does'nt exactly works like Copy and Paste :
-first you must already set "Select Object When Created" in the Option box/General Options, if you want to work step by step ...
-2nd in this situation ("Select Object When Created" setted), the selection handel are often lost, so that you can't work step by step properly ... like with Copy and Paste.

But the big advantage is that this command does not use the Windows Clipboard, so any contents in the Clipboard are not erased or changed.

Also i write the following macro, to "repair" that, and assign it to "N" shortcut key (i assign the classical "Duplicate" to "Schift N") .
In the eyes of the user, it run exactly like the classic command "Duplicate", but remember of the handles sets properly.

I write these macro for the french version of designcad i use (v. 18.33) , but compatibility is for every version of Designcad ; these macro use succesively "duplicate" (at the same placement) and "move" commands (which have the same screen box, but not the sames Displays quick help in the Status Bar, depending of the number of handles sets).

Because i don't have such english or U.S. version of Designcad, please translate the messages (a$ and b$) for the Status bar in the >move command (see previously what is writed in the Designcad command) !

Be carrefull too that to undo it, you must action "Undo" twice.

[code]
'Duplicate with selectionned when created

If sys(80)<1 then goto fin

sys(996) = 1   'Enhanced Esc Key Behavior
sys(36)=2      'super silent mode
a=sys(242)      'to store the Select Object When Created statement at the begining of the macro
sys(242)=0      'not selected when created

Sx=sys(190)     'Selection Handle 1 X value
Sy=sys(191)     'Selection Handle 1 Y value
Sz=sys(202)     'Selection Handle 1 Z value
Tx=sys(192)     'Selection Handle 2 X value

Testhdl:
'test to find if there is more than one handle set
'for the Displays quick help in the Status Bar of move command

>SelectMove
{
  <Pointxyz [Sx-10,Sy-10,Sz-10]
  }

Ax=sys(192)     'moved Selection Handle 2 X value

>SelectMove
{
  <PointXYZ [Sx,Sy,Sz]
  }

Duplic:

>SelectDuplicate   
{
  <PointXYZ [Sx,Sy,Sz]
  <Type 1
  <Reference 0
  }

a$="Poser les points: 1-R