If not

Discussion in 'AutoCAD' started by Adesu, Feb 25, 2005.

  1. Adesu

    Adesu Guest

    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 c:eek:md (/ 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)
    )
     
    Adesu, Feb 25, 2005
    #1
  2. Adesu

    zeha Guest

    Hi,

    Use dwgtitled
    replace
    (if (not (= (getvar "DWGNAME") "Drawing1.dwg"))
    with
    (if (/= (getvar "DWGTITLED") 0)

    regards

    Harrie
     
    zeha, Feb 25, 2005
    #2
  3. Adesu

    Adesu Guest

    Hi zeha ,thanks a lot for your info,it's that right
     
    Adesu, Feb 28, 2005
    #3
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.