How to send commands to outher Drawings ??

Discussion in 'AutoCAD' started by Vxc, Mar 18, 2005.

  1. Vxc

    Vxc Guest

    Hy all !

    I'm writing a code on VLisp that opens several drawings.I run the code
    on the "Drawing1.dwg" (blank one) and behind autocad opens all drawings.So
    far so good...
    My ideia is to run other lisp on those files.I now that there is the
    "vlax-invoke-method" but with this I only run autocad commands.
    How can I run a lisp on those files ?.
    I've tried but when I change to that drawing all variables go nil so a
    must send commands to those files without put them active.

    I hope I made myself clear.

    Anybody has the solution ??

    Thanks in Advance !!

    Vxc
     
    Vxc, Mar 18, 2005
    #1
  2. I don't know if this will help you. I used a script file with a lisp program to open other drawing and run the lisp program in other drawings. The lisp generated the next drawing number and ran the script. The script opened the next drawing and ran the lisp. If you need to pass variables between files, you could create a txt file with the open function and use the write-line and read-line functions to save the values. I hope that gives you some ideas.
     
    whitesquirrel44, Mar 18, 2005
    #2
  3. Vxc

    hmsilva Guest

    Que comandos queres utilizar nos desenhos abertos???

    Henrique
     
    hmsilva, Mar 18, 2005
    #3
  4. Vxc

    jlspartz Guest

    I agree, make your lisp, load it into autocad, then make a script to open each drawing and run the lisp. I use the program Hurricane which you can get here:
    www.74mph.com
     
    jlspartz, Mar 18, 2005
    #4
  5. Vxc

    Vxc Guest

    Thanks for the hints and the site i'll will check it at home.
    :)

    Henrique -> eu kero abrir varios desenhos em k utilizo uma lisp k os
    trabalha.mas kando se muda de folha ele baralha-se e blokeia.tenho k
    descobrir um modo em programacao de 'enviar' comandos a um desenhos ja
    aberto mas sem ele tar activo.o comando k te falei o 'envoke' funciona mas
    so par comandos do cad (open/zoom etc)
    de maneira simples: correr uma lisp em cada desenho,saltando de desenho
    em desenho !
     
    Vxc, Mar 18, 2005
    #5
  6. Vxc

    hmsilva Guest

    Try this...

    Cherrs

    Henrique
     
    hmsilva, Mar 21, 2005
    #6
  7. Vxc

    Vxc Guest

    Tenho andado a matar a cabeça com isto, vou ver o teu codigo a ver se me
    safo.Tb tenho um acad.lsp mas e so para carregar o "(vl-load-com)" que sao
    os comandos de VLisp.

    Obrigado vou já ver isto e já te digo algo !

    Vxc
     
    Vxc, Mar 21, 2005
    #7
  8. Vxc

    hmsilva Guest

    Se alterares esta linha

    (vla-open (vla-get-documents (vlax-get-acad-object)) dwgname)

    que me deste, para

    (vla-activate (vla-open (vla-get-documents (vlax-get-acad-object)) dwgname))

    já fica activo...

    O outro codigo está a correr mal?

    abraço

    Henrique
     
    hmsilva, Mar 21, 2005
    #8
  9. Vxc

    Shane-W Guest

    (vl-propagate 'your_var)

    Use this if you need to get a variable to the new drawings.
    it will set the variable in all opened drawings and newly opened drawings
     
    Shane-W, Mar 21, 2005
    #9
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.