Toggle between drawings?

Discussion in 'AutoCAD' started by Rudy Tovar, Feb 18, 2005.

  1. Rudy Tovar

    Rudy Tovar Guest

    Actually, you can write the lisp to create a script on the fly and have it
    close the previous drawing...
     
    Rudy Tovar, Feb 22, 2005
    #21
  2. Rudy Tovar

    T.Willey Guest

    Thanks Jason, Rudy for the ideas. I will have to play around and see what I can come up with.

    Tim
     
    T.Willey, Feb 22, 2005
    #22
  3. Rudy Tovar

    T.Willey Guest

    Jason (or anyone who knows),

    Is there a reason why this won't work?
    (command "_.vbastmt" "documents.item(GetDocNumber DocCol (vla-get-Name ErrChk)).activate")
    But this does?
    (command "_.vbastmt" "documents.item(2).activate")

    All are valid variables. From the command line.
    Command: (GetDocNumber DocCol (vla-get-Name ErrChk))
    2

    Command: (command "_.vbastmt" "documents.item(GetDocNumber DocCol (vla-get-Name
    ErrChk)).activate")
    _.vbastmt
    Expression: documents.item(GetDocNumber DocCol (vla-get-Name ErrChk)).activate
    Syntax Error

    Command: (command "_.vbastmt" "documents.item(2).activate")
    _.vbastmt
    Expression: documents.item(2).activate
    Command: nil

    Can you just not use sub-functions with the vbastmt command?

    Thanks.
    Tim
     
    T.Willey, Mar 1, 2005
    #23
  4. Not sure, I've never tried.
     
    Jason Piercey, Mar 1, 2005
    #24
  5. Found this tucked away in a file, perhaps it helps?
    (from Doug Broad, IIRC)

    (command "vbastmt"
    "documents.item(documents.count-1).sendcommand \"(load
    \"\"setup\"\")(c:setup) \" ")
     
    Jason Piercey, Mar 1, 2005
    #25
  6. Rudy Tovar

    T.Willey Guest

    This one switches (I'm guessing) to the last drawing, then loads the file setup, and runs it. It doesn't look like it will accept a lisp variable. I will look into coding it like it was vba variable, then I'm thinking it will work.

    Thanks.
    Tim
     
    T.Willey, Mar 1, 2005
    #26
  7. Rudy Tovar

    T.Willey Guest

    This one worked on my tests.
    (command "_.vbastmt" (strcat "documents.item \(\"" (vla-get-Name ErrChk) "\"\).activate"))

    Where ErrChk is a valid document object.

    Thanks for the point in the right direction.
    Tim
     
    T.Willey, Mar 1, 2005
    #27
  8. You bet, glad I could (sort of) help.
     
    Jason Piercey, Mar 1, 2005
    #28
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.