本帖最后由 sachindkini 于 2013-4-17 19:57 编辑
dear sir
this lisp working in 2011 but not working 2013 (windows 8 64 bit)
- Command: BIGBOARD
- ; error: bad argument type: FILE nil
复制代码 - (defun C:BigBoard ( / userclick dlgname dcl_id big-board-list _make-dialog)
- ;; bigboard
- (defun _make-dialog ( / fn f dcl )
- (setq fn (strcat (vl-filename-directory (findfile "acad.exe"))"\\$vld$.dcl")
- f (open fn "w")
- dcl
- '(
- "board : dialog {"
- ": list_box {"
- "key = "selections";"
- "multiple_select = true;"
- "height = 19;"
- "allow_accept = true;"
- "}"
- "ok_cancel;"
- "}"
- )
- )
- (mapcar
- (function
- (lambda ( x )
- (princ x f)
- (princ "\n" f)
- )
- )
- dcl
- )
- (close f)
- fn
- )
- (defun setItems (val lst / ret)
- (foreach n (mapcar (function (lambda (n) (- n 48)))
- (vl-remove 32 (vl-string->list val))
- )
- (setq ret (cons (nth n lst) ret))
- )
- (reverse ret)
- )
- (setq big-board-list '("Command Description"
- "-----------------------------------------------------------"
- "Co Copy"
- "M Move"
- "Ano Automatic Numbering"
- "Dr Door"
- "Ww Window"
- "Acal Area Calulation")
- )
- (setq dcl_id
- (load_dialog
- (setq dlgname (_make-dialog))))
- (if (not (new_dialog "board" dcl_id))(exit))
- (start_list "selections")
- (mapcar 'add_list big-board-list)
- (end_list)
- (action_tile "selections" "(setq strLst (setItems $value big-board-list))")
- (setq userclick (start_dialog))
- (unload_dialog dcl_id)
- (vl-file-delete dlgname)
- (and (= 1 userclick)
- (and strLst (print strLst)))
- (princ)
- )
|