home *** CD-ROM | disk | FTP | other *** search
- ' This macro reads in an ASCII text file found in the DesignCAD directory,
- ' reads in the filename on each line, then opens each file,
- ' then exports the file out to a 500 pixel wide JPG
- '
- ' Create the input file with the DIR /B *.DC >filename.txt DOS command to get an
- ' ASCII text file that contains ONLY filenames in the directory.
- '
- ' Open the input File
- open "i", 1, "*\KDW.txt"
- ' Loop to get Values from ASCII text file until done
- do while eof(1) = 0
- ' Get FileNameValue from file
- input #1, temp$
- ' Add DesignCAD path to filename to open
- temp2$ = Sys$(36) + "\" + temp$
- ' Opens each file and fits it to window
- >Open
- {
- <Filename [temp2$]
- }
- >FitToAllWindow
- {
- }
- ' Makes Output File Strings
- Bob = LEN(temp2$)
- Bob = Bob -3
- C$ = LEFT$(Temp2$, Bob)
- D$ = C$ + ".JPG"
- >SaveBMP
- {
- ' You can preset points if you want to, but this sample doesn't;
- ' You can also use the incomplete flag, (remmed out in this version)
- ' to let the user set 2 points for the area of the screen to save to
- ' the image
- '<Pointxyz 0, 0, 0
- '<Pointxyz 150, 200, 0
-
- ' If the filename isn't specified, you get prompted for it.
- ' If you were to hardcode it, the filename line would look like this
- ' <Filename "C:\dcad3000\harvey.jpg", or
- ' <Filename "*\harvey.jpg"
- <Filename [D$]
- ' Types are:
- ' 0= current display (if you use this and change the pixel size, you
- ' get "chunky" pixels in your image.)
- ' Also, if you have Graphics Acceleration active in the view you save,
- ' and you change the pixel size, you get chunky pixels no matter which
- ' type you choose.
- ' 1 = wireframe
- ' 2 = quickshade (non-OpenGL)
- ' 3 = smoothshade (non-OpenGL)
- ' 4 = hidden (non-OpenGL)
- ' default Type ( if Type not specified in the macro ) is 0
- <Type 1
- ' You can specify either height or width.
- ' If both are specified, the last one given takes precedence.
- ' The other dimension is adjusted proportionately.
- ' If neither is given the bitmap is saved at its current size.
- ' <Width 500
- <Height 500
- ' The Incomplete parameter waits for the user to set points
- ' not used in this macro
- '<Incomplete
- }
- ' Closes each file
- >Close
- {
- <SaveChanges 0
- <FileName [temp2$]
- }
- loop
- Close #1
- end