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 / Batch JPG Export.d3m < prev    next >
Encoding:
Text File  |  2003-09-29  |  2.3 KB  |  73 lines

  1. ' This macro reads in an ASCII text file found in the DesignCAD directory,
  2. ' reads in the filename on each line, then opens each file, 
  3. ' then exports the file out to a 500 pixel wide JPG
  4. '
  5. ' Create the input file with the DIR /B *.DC >filename.txt DOS command to get an 
  6. ' ASCII text file that contains ONLY filenames in the directory.
  7. '
  8. ' Open the input File
  9.     open "i", 1, "*\KDW.txt"
  10. ' Loop to get Values from ASCII text file until done
  11.     do while eof(1) = 0
  12. ' Get FileNameValue from file
  13.         input #1, temp$
  14. ' Add DesignCAD path to filename to open
  15.     temp2$ = Sys$(36) + "\" + temp$
  16. ' Opens each file and fits it to window
  17.     >Open
  18.       {
  19.     <Filename [temp2$]
  20.       }
  21.     >FitToAllWindow
  22.      {
  23.       }
  24. ' Makes Output File Strings
  25.     Bob = LEN(temp2$)
  26.     Bob = Bob -3
  27.     C$ = LEFT$(Temp2$, Bob)
  28.     D$ = C$ + ".JPG"
  29. >SaveBMP
  30. {
  31.   ' You can preset points if you want to, but this sample doesn't;
  32.   ' You can also use the incomplete flag, (remmed out in this version)
  33.   ' to let the user set 2 points for the area of the screen to save to 
  34.   ' the image
  35.   '<Pointxyz 0, 0, 0
  36.   '<Pointxyz 150, 200, 0
  37.  
  38.   ' If the filename isn't specified, you get prompted for it.
  39.   ' If you were to hardcode it, the filename line would look like this
  40.   ' <Filename "C:\dcad3000\harvey.jpg", or
  41.   ' <Filename "*\harvey.jpg"
  42.     <Filename [D$]
  43.   ' Types are:
  44.   ' 0= current display (if you use this and change the pixel size, you
  45.   '    get "chunky" pixels in your image.)
  46.   '    Also, if you have Graphics Acceleration active in the view you save,
  47.   '    and you change the pixel size, you get chunky pixels no matter which
  48.   '    type you choose.
  49.   ' 1 = wireframe
  50.   ' 2 = quickshade (non-OpenGL)
  51.   ' 3 = smoothshade (non-OpenGL)
  52.   ' 4 = hidden (non-OpenGL)
  53.   ' default Type ( if Type not specified in the macro ) is 0
  54.     <Type 1
  55.   ' You can specify either height or width.
  56.   ' If both are specified, the last one given takes precedence.
  57.   ' The other dimension is adjusted proportionately.
  58.   ' If neither is given the bitmap is saved at its current size.
  59.  ' <Width 500
  60.    <Height 500
  61.   ' The Incomplete parameter waits for the user to set points
  62.   ' not used in this macro
  63.   '<Incomplete
  64.  }
  65. ' Closes each file
  66.     >Close
  67.      {
  68.     <SaveChanges 0
  69.     <FileName [temp2$]
  70.      }
  71. loop
  72. Close #1
  73. end