regen all open documents

Discussion in 'AutoCAD' started by FloriB, Aug 19, 2003.

  1. FloriB

    FloriB Guest

    want to regen all open documents. therefor i use vlisp to create a list containing all open documents as objects.

    the list can look something like this:
    (#<VLA-OBJECT IAcadDocument 0112392c> #<VLA-OBJECT IAcadDocument 01103f8c> #<VLA-OBJECT IAcadDocument 01130abc>)

    to regen all those documents i use this code:

    (setq iLength (length lListOfDocuments) iCount 0)
    (command "_regen" "")
    (repeat iLength
    (vla-put-activedocument (vlax-get-acad-object) (nth iCount lListOfDocuments))
    (command "_regen" "")
    (setq iCount (1+ iCount))
    )

    but it won't work. :(
    does someone have a solution for this problem?
     
    FloriB, Aug 19, 2003
    #1
  2. FloriB

    FloriB Guest

    soory for the bad structure of the text.
    this one ist with <br>'s:

    want to regen all open documents.
    therefor i use vlisp to create a list containing all open documents as objects.

    the list can look something like this:
    (#<VLA-OBJECT IAcadDocument 0112392c> #<VLA-OBJECT IAcadDocument 01103f8c> #<VLA-OBJECT IAcadDocument 01130abc>)

    to regen all those documents i use this code:

    (setq iLength (length lListOfDocuments) iCount 0)
    (command "_regen" "")
    (repeat iLength
     (vla-put-activedocument (vlax-get-acad-object) (nth iCount lListOfDocuments))
     (command "_regen" "")
     (setq iCount (1+ iCount))
    )

    but it won't work. :(
    does someone have a solution for this problem?
     
    FloriB, Aug 19, 2003
    #2
  3. (setq iLength (length lListOfDocuments) iCount 0)
    I know very little about VL commands, but I'm pretty sure you can't have a
    variable start with a number (1ListOfDocuments). Also, you don't need the
    first (command "_regen"). the NTH command starts at the first one (#0, in
    fact), and will scroll thru the lot of them. I believe (someone tell me if
    I'm wrong) you need to access the acad-object before starting the REPEAT
    loop.
    Anybody else ?

    Dr Fleau
     
    Pierre Marcotte, Aug 19, 2003
    #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.