我已经研究这个问题8个多月了。
我用我所有的技巧,还有很多我没有的技巧,把我(现在)的骄傲和快乐,亲切地命名为闪电战。因为它是为我们在工作中使用的绘图设备定制的,所以我决定省去“绒毛”,为优秀的人提供重要的部分。。也就是说,只是闪电战。
也就是说,请允许我谦恭地介绍我的批lisp。如果你对它的功能有任何疑问,请告诉我。此外,我知道还有一些松散的结尾,我相信这可以从头开始,并重新工作到更有效的东西。如果你有任何意见或建议,请告诉我。
第1部分,共2部分
- ; Blitz Batch Program
- ; Written by Mark Mercier, with a little help from my friends
- ; Version history:
- ; 08/06/08 v3 Alpha - printlayout, makeitso and dostuff functions operating
- ; 08/07/08 v3.1 Alpha - printsettings function operating
- ; 08/07/08 v3.14 Beta - makeitso function operating, first Beta version.
- ; 09/10/08 v3.141 - Most non-setting-related bugs removed and help option added. Improved layout list functionality.
- ; 01/23/09 v3.1415 - Added function for selection of multiple settings
- ; 01/30/09 v3.14159 - Added function for complex tab selection
- ; 04/03/09 v3.141592 - Added function for plotting all files in a directory
- ; 04/10/09 v3.1415926 - Added subdirectory capability
- (defun c:bz() (blitz))
- (defun blitz()
- (princ "\n** Blitz - v3.1415926 **\n")
- (printsettings) ; Determine print settings
- (printlayout) ; Determine layouts to plot
- (if warpFactor (engage) (makeitso)) ; Use collected variables to plot
- (princ)
- )
- ; - Begin function set for collecting print settings - ;
- (defun printsettings()
- (setq multSettings nil)
- (setq printSetting nil)
- (setq printSettingList nil)
- (setq dirget "none")
- (setq dirPat "*")
- (setq dirSub "0")
- (setq warpFactor nil)
- (setq blitzPrintInputList nil)
- (setq copies 1)
- (setq printsetWhile 1)
- (GetPlotDevices)
- (while (= printsetWhile 1)
- (setq printsettingCheck nil)
- (princ "\n[0 - Setting1]")
- (setq printsettingGet (getstring "\nSelect number or [mUltiple/Directory/Files/?]: "))
- (cond
-
- ; Create a condition to test for user input. In the (dostuff) function, create a correlating condition which supplies said function.
- ; If plotting, create a function to check whether plot device exists, thereby allowing the user to remain in program loop upon device failure.
- ; Similarly, functions can be present within the condition to test any other user input aside from selected setting, as to prevent errors later.
- ((= printsettingGet "0") (printcheck))
-
- ((or (= (strcase printsettingGet) "D") (= (strcase printsettingGet) "DIRECTORY")) (directoryGet))
- ((= (strcase printsettingGet) "U") (setq multSettings 1))
- (t
- (princ "\nOption not available, please select another.")
- )
- )
- )
- (princ printSettingList)
- (setq blitzPrintInputList (append blitzPrintInputList (list (list (itoa copies)))))
- (setq blitzPrintInputList (append blitzPrintInputList (list printSettingList)))
- )
- (defun printcheck()
- ; Check to see if the current selection is kosher. If plot device or other settings are unavailable, inform the user and return to main loop.
- (if (or (= printsettingCheck nil) (membercase printsettingCheck DEVICELIST))
- (progn
- (if multSettings
- (progn
- (setq printSettingList (append printSettingList (list printSettingGet)))
- (princ "\nPrint setting appended")
- (setq acceptWhile nil)
- (while (not acceptWhile)
- (princ "\nCurrent settings: ")(princ printSettingList)(princ)
- (setq acceptSettings (getstring "\nContinue with selected plot settings? [Yes/No/Remove] <No> "))
- (cond
- ((or (= acceptSettings "Y") (= acceptSettings "y"))
- (setq printsetWhile 2)
- (setq acceptWhile 1)
- )
- ((or (= acceptSettings "") (= acceptSettings "N") (= acceptSettings "n"))
- (setq acceptWhile 1)
- )
- ((or (= acceptSettings "R") (= acceptSettings "r"))
- (removeSetting)
- )
- (t
- (princ "\nOption not available, please try again")
- )
- )
- (if (not printSettingList)
- (progn
- (setq acceptWhile 1)
- (princ "\nAll selections removed.")
- )
- )
- )
- )
- (progn
- (setq printSettingList (list printsettingGet))
- (setq printsetWhile 2)
- (princ "\nPrint setting accepted")
- )
- )
- )
- (progn
- (princ "\nPrint setting not available.")
- )
- )
- )
- (defun removeSetting()
- (setq removeWhile nil)
- (while (not removeWhile)
- (setq removeOption (getstring "\nEnter desired setting to remove: "))
- (if (member removeOption printSettingList)
- (progn
- (setq printSettingList (remFromList removeOption printSettingList))
- (setq removeWhile 1)
- (princ "\nSetting removed.")
|