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 / Get_Points.d3m < prev    next >
Encoding:
Text File  |  2003-09-29  |  935 b   |  30 lines

  1. ' This simple macro asks the user for a string, then allows them to set
  2. ' one point.  The string and XYZ value of the point are written out to
  3. ' an ASCII text file in the DesignCAD directory.
  4. '
  5. ' Create an Array for the points the user sets
  6.     Dim X(1), Y(1), Z(1)
  7. ' Open the Data file, (*\ denotes the DesignCAD directory).
  8.     open "o", 1, "*\KDW.txt"
  9. ' Loop from end
  10.     Start:
  11. ' Set Precision to 7 places to the right of the decimal
  12.     Precision 7
  13. ' Prompt User to for value to be exported to the file with this point
  14.     input "Enter Value for . . .", val$
  15. ' Prompt User for Point
  16.     setpoint "Set point . . . " 1
  17. ' Store points the user just set into the Array
  18.     for a = 1 to Sys(1)
  19.         PointVal X(a), Y(a), Z(a) a
  20.         temp$ = val$,"  ",X(a), Y(a), Z(a)
  21.         Print #1, Temp$
  22.     next a
  23. ' Loop to start?
  24.     input "Done?, Y/N", val2$
  25.     if val2$ = "n" then goto Start
  26.     if val2$ = "N" then goto Start
  27. ' Close Data File
  28.     Close #1
  29. end
  30.