I 've a code /script and added a if and not,but I don't know this code true or wrong,would you correction for this script,thanks. ; omd is stand for open multiple drawing ; Design by Ade Suharna <> ; 23 February 2005 ; Program no.203/02/2005 ; Idea from Frank Whaley 1). (defun cmd (/ osdi alls n file cnt) (vl-load-com) (setq osdi (getvar "sdi")) (setvar "sdi" 0) (setq cnt 0) (setq alls '("C:/Auto CAD 2000/Drawing1.DWG" "C:/Auto CAD 2000/Drawing2.DWG" "C:/Auto CAD 2000/Drawing3.DWG" "C:/Auto CAD 2000/Drawing4.DWG" "C:/Auto CAD 2000/Drawing5.DWG")) (setq n (length alls)) (repeat n (setq file (nth cnt alls)) (if (not (= (getvar "DWGNAME") "Drawing1.dwg")) ;>>>>>here code (setq file (cdr alls)) ) (if (= 0 (getvar "SDI")) ;1). (vla-activate (vla-open (vla-get-documents (vlax-get-acad-object)) file)) (vla-sendcommand (vla-get-activedocument (vlax-get-acad-object)) (strcat "(command \"_open\")\n" file "\n"))) (setq cnt (1+ cnt)) ) (setvar "sdi" osdi) )
Hi, Use dwgtitled replace (if (not (= (getvar "DWGNAME") "Drawing1.dwg")) with (if (/= (getvar "DWGTITLED") 0) regards Harrie