home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2003 November / PCWK1103B.iso / DesignCAD 3D Max PLUS trial 30 / DATA1.CAB / Example_Files / Sample_Macros / Offset Objects.d3m < prev    next >
Encoding:
Text File  |  2003-09-29  |  913 b   |  35 lines

  1. ' This simple macro asks users for X and Y offsets,
  2. ' then moves the selected items by the entered distances.
  3. ' Make sure something is selected before starting
  4.     if Sys(80) = 0 then
  5.         Message "Please select an object before using this macro."
  6.         goto Ender
  7.     endif
  8. ' Un-remark these next 2 lines to make the input box appear in the upper 
  9. ' left corner of the DesignCAD window, so it does not cover the drawing area.
  10.     ' Sys(130) = 5
  11.     ' Sys(131) = 5
  12. ' Get Distances from user
  13.     Input "DX Movement", DX
  14.     Input "DY Movement", DY
  15. ' Get Coordinates of the Selection Handle
  16.     ' X value of 1st handle
  17.         OrgX = Sys(190) 
  18.     ' Y value of 1st handle
  19.         OrgY = Sys(191) 
  20. ' Move Objects with DragMove instead of SelectMove or Move
  21. ' since it only considers the primary selection handle.
  22.     >DragMove
  23.     {
  24.     <PointRel [OrgX + DX], [OrgY + DY], 0
  25.     }
  26. ' Refresh the Screen
  27.     >Regenerate
  28.     {
  29.     }
  30. Ender:
  31. End
  32.  
  33.  
  34.