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 / Area.d3m < prev    next >
Encoding:
Text File  |  2003-09-29  |  850 b   |  38 lines

  1. ' This simple macro draws a 20x20 box with it's lower left corner
  2. ' at x10, y10, then calculates the area of the box.  After the 
  3. ' area box is displayed for the user, the result of the area command
  4. ' used on the box is added to the drawing as a piece of text
  5. '
  6. >2DBox
  7.   {
  8.   <Color 0,0,0
  9.   <Layer 5
  10.   <LineStyle 0,2.0000,0.0000
  11.   <PointXYZ 10.0000,10.0000,0.0000
  12.   <PointXYZ 30.0000,30.0000,0.0000
  13.   <Type 1
  14.   <Orientation 0
  15.   }
  16. '
  17. >FitToWindow 
  18.   {
  19.   }
  20. '
  21. >Area
  22.   {
  23.   <PointXYZ 10.0000,10.0000,0.0000
  24.   <PointXYZ 30.0000,10.0000,0.0000
  25.   <PointXYZ 30.0000,30.0000,0.0000
  26.   <PointXYZ 10.0000,30.0000,0.0000
  27.   <PointXYZ 10.0000,10.0000,0.0000
  28.   }
  29. ' Add area text to drawing
  30.   Text$ = Sys(655)
  31.   >text  
  32.   {
  33.   <PointXYZ 10.0000,20.0000,0.0000
  34.   <PointXYZ 30.0000,20.0000,0.0000
  35.   <text "Area of Box is: "[Text$]
  36.   }
  37.  
  38.