a pulldown to open a file directory to OPEN a dwg, not insert

Discussion in 'AutoCAD' started by John Crocco, Apr 21, 2004.

  1. John Crocco

    John Crocco Guest

    I made a pulldown and a button to insert using "getefiled" and the directory
    for my blocks would come up so I can pick the file, thus not having to
    navigate to it.

    I wanted to do similar as above except to "open" the file, rather than
    insert without having to navigate to it, but cant get it to work. Is there
    another command needed other than getfiled?
     
    John Crocco, Apr 21, 2004
    #1
  2. John Crocco

    ECCAD Guest

    John,
    Something like this..
    (setq dwg (getfiled "Select Drawing to Open" "c:/ec/d_iso/cyl/" "dwg" 2))
     
    ECCAD, Apr 21, 2004
    #2
  3. John Crocco

    John Crocco Guest

    This is what I get:

    Command: (setq dwg (getfiled "Select Drawing to Open" "c:/program
    files/autocad
    2002/z/" "dwg" 2)) "C:\\Program Files\\AutoCAD 2002\\Z\\-101a.dwg"

    Here is my menu entry:

    ID_User [Open Z file . . .](setq dwg (getfiled "Select Drawing to
    Open" "c:/program files/autocad
    2002/z/" "dwg" 2))

    What am I doing wrong?
     
    John Crocco, Apr 21, 2004
    #3
  4. John Crocco

    Javier Tapia Guest

    Hi

    With getfiled you gets the drawing's FILENAME, and you store it in the DWG
    variable. The content of this is the string returned for your routine.
    I.e, your lisp line only gets the NAME of the file.
    Now, you need take the DWG variable (the file name) and use it with to open
    the drawing.
    Something like this:
    (setq "filedia" 0)
    (command "_open" DWG)
    Sad to say, this lines not work. I don't know if exist any Lisp routine to
    open a dwg file. :-(

    (Sorry, mi English is very poor)
    --
    Greetings
    Javier Tapia
    Santiago de Chile

     
    Javier Tapia, Apr 22, 2004
    #4
  5. John Crocco

    Mark Propst Guest

    actualmente es muy bueno!
    mejor que muchos de nos gringos!
    :)
    Mark
     
    Mark Propst, Apr 22, 2004
    #5
  6. John Crocco

    ECCAD Guest

    Now that you have selected the 'dwg' to open, you need to open it;
    At end of existing Macro..Add:
    (if dwg (command "_open" dwg));
    OR
    Change it to: (command "_open" (setq dwg (getfiled "Select Drawing to Open" "c:/program
    files/autocad
    2002/z/" "dwg" 2)) )

    Bob
     
    ECCAD, Apr 22, 2004
    #6
  7. John Crocco

    Javier Tapia Guest

    ;-)

    --
    Saludos
    Javier Tapia
    Santiago de Chile

     
    Javier Tapia, Apr 22, 2004
    #7
  8. John Crocco

    John Crocco Guest

    Its still not working, here is the entry in my menu file:
    ID_User [Open Z file . . .](command "_open" (setq dwg (getfiled
    "Select Drawing to Open" "c:/program
    files/autocad 2002/z/" "dwg" 2)) )

    Here is the result from autocad:
    Command: (command "_open" (setq dwg (getfiled "Select Drawing to Open"
    "c:/program files/autocad 2002/z/" "dwg" 2)) ) _open
    Command: C:\Program Files\AutoCAD 2002\Z\-107.dwg Unknown command
    "C:\PROGRAM
    FILES\AUTOCAD 2002\Z\-107.DWG". Press F1 for help.
    Command: nil

    This really shouldnt be that hard, but cant figure it out.
     
    John Crocco, Apr 23, 2004
    #8
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.