I just cant get it to work.
this code reads a text file of previously opened dwgs.
what im looking to do is open the selected dwg.
it highlights the dwg fine and unless i specify the dwg in the code, it doesnt
work.
can someone help me get it to where it will open the dwg thats selected
thanks for any and all help
(setq DCL (load_dialog "history"))
(defun READFILE (/ FILE A)
(setq FILE (open TXTFILE "r"))
(while (setq A (read-line FILE)) (setq TXTLIST (cons A TXTLIST)))
;while
(close FILE)
(setq TXTLIST (reverse TXTLIST))
(DCL_LIST)
) ;readfile
;;
(defun DCL_LIST ()
(new_dialog "history" DCL)
(start_list "txtlist")
(mapcar 'add_list TXTLIST)
(end_list)
) ;dcl_list
;;
(defun opn ()
(setq fqnName "F:\\dwgs\\job\\A-12966.dwg") <--- this is where it needs to
read the selected dwg not a set dwg
(command "._VBAStmt" (strcat "AcadApplication.Documents.Open \"" fqnName
"\"")
)
)
(defun C:history ()
(setvar "cmdecho" 0)
(setq fDATE (menucmd "M=$(edtime,$(getvar,date), MON DD YYYY)"))
(SETQ txtlist NIL)
(setq TxtFile (strcat "c:\\dwg-history" fdate ".txt"))
(setq Opened (open TxtFile "r"))
(READFILE)
(set_tile "txtlist" "0")
(setq PICK "0")
(set_tile "filename" TXTFILE)
(action_tile "txtlist" "(setq pick $value)")
(action_tile "dwg" "(done_dialog 1)")
(action_tile "cancel" "(done_dialog 0)")
(setq BUTTON (start_dialog))
(cond ((= BUTTON 1) (opn))
) ;cond
)
(princ)
<edit: code tags added by CAB>
its not a DCL file