Author Topic: cz.d3m, copyzero.d3m pz.d3m pastezero.d3m (copy/paste in-place routines)  (Read 613 times)

prl

  • Hero Member
  • *****
  • Posts: 3389
  • A Bézier Extrusion
Old routines from about 2008.  I believe inspired by RobS.

also called copyzero.d3m, clipzero.d3m, cz.d3m,  pastezero.d3m, pz.d3m

prl=KWsclipzero.d3m

What they do and why:

Sometimes you want to save a copy of a selection set to the clipboard and have it reinsert in the same exact position it was located when you made the copy.  For example, you are going to do a Solid subtract operation, and by default DesignCAD will remove the subtracting solid after it is done making the new solid with the new hole or notch in it.  But you not only want the hole or notch, you want to retain the solid that made that opening.  That is where these two routines come in.  Before you do the solid subtraction, make a cz.d3m copy of it.  After you have completed the solid subtraction, and everything appears correct (the solid subtract was a success),  you issue pz.d3m and have the subtracting solid put back in the original position.

The two routines are useful for "clipboard remembering" a selection at a specific location in 3d space and pasting back at that location. A copy in-place and paste in-place.  Could be anything, not necessarily solids.  Say a set of curves, before you have DesignCAD do something to them (maybe smooth them, point reduction, etc.).  That way you can put back what you had in the same location should DesignCAD decide to give you lemons or if you want to overlay what you had before with what you have now, etc.

How is this different than Undo?  Different concept but you'll get it when you have the need for it.


Code: [Select]
'Program: clipzero.d3m (copy to clipboard using 0,0,0 as handle)
if sys(80)=0 then
  Message "Nothing selected. . . routine will end, press any key"
  END
end if
sys(36)=1
>sethandle
{
<type 0
<pointxyz [0,0,0]
}
>copy
{
}
sys(36)=0
end

Code: [Select]
'Program: pastezero.d3m (paste from clipboard using 0,0,0 as handle)

sys(36)=2
>paste
{
<pointxyz [0,0,0]
}

sys(1) = 0
sys(80) = 0
sys(36)=0
regen

End
« Last Edit: February 26, 2015, 02:40:10 AM by prl »