Results 1 to 2 of 2

Thread: Applying Script To Multiple layouts problem?

  1. #1
    Member pierredib's Avatar
    Join Date
    2007-06
    Posts
    11
    0 Did you find this post helpful? Yes

    Default Applying Script To Multiple layouts problem?

    Hello All:
    This is the Problem I can't find a solution for:
    I'm working with drawings and each drawing contains 4 layouts,1 layout for every zone of the basements (every basement floor has 4 zones=>4 layouts for the same floor with 1 architectural xref ).I'm running a batchscript that opens the file ,erase the title block, replace it with another block ,zoom extents in tilemode=0 and tilemode =1, do a qsave then exit and start with another file,it's working for the first layout but the other 3 layouts are still the same with no modifications,Is there a way to issue a command that will switch from one layout to the next so I can repeat the same script for the other 3 layouts.does anyone have a script that will do this sequential switch from 1st layout to all other layouts on the same file.Any help is appreciated.

  2. #2
    Certifiable AUGI Addict irneb's Avatar
    Join Date
    2007-07
    Location
    Jo'burg SA
    Posts
    4,492
    0 Did you find this post helpful? Yes

    Default Re: Applying Script To Multiple layouts problem?

    You'll have to add some LISP to your script, e.g. (remove the comments marked in green):
    Code:
    ;; Get a VLAX handle to the document
    (setq doc (vla-get-ActiveDocument (vlax-get-acad-object)))
    ;; Get the collection of Layouts
    (setq tabs (vla-get-Layouts doc))
    ;; Step through each layout
    (vlax-for tab tabs
      ;; Check if not Model tab
      (if (not (vla-get-Name tab) "Model")
        (progn
          (setvar "CTAB" (vla-get-Name tab)) ;Open current tab
          (command "_ERASE" (ssget "x" '((0 . "INSERT") (2 . "OldBlockName"))) "") ;Command to erase old TB
          (command ".-INSERT" "c:\\Path\\NewBlockName.DWG" "0,0" "" "" "");Command to insert new
           (command "_ZOOM" "_Extents")
        )
      )
    )
    TILEMODE 1
    ZOOM E
    QSAVE
    Knowledge is proportional to experience, but wisdom is inversely proportional to ego!
    My little bit of "wisdom": Hind-sight is useless, unless used to improve the next forethought!

Similar Threads

  1. 2012: Applying Page setup to all layouts at once
    By Darren Allen in forum AutoCAD General
    Replies: 22
    Last Post: 2013-01-22, 02:15 PM
  2. applying multiple object markers
    By randall.hanes in forum AutoCAD Civil 3D - Sections
    Replies: 0
    Last Post: 2009-10-28, 09:20 PM
  3. Multiple layouts vs Multiple drawing files
    By mmilko.83044 in forum CAD Standards
    Replies: 26
    Last Post: 2009-06-12, 05:15 PM
  4. Help with applying multiple Actions to a Dynamic Block
    By james.126519 in forum Dynamic Blocks - Technical
    Replies: 22
    Last Post: 2006-11-14, 08:07 PM
  5. Multiple script problem
    By DAVIDALLIN in forum AutoCAD General
    Replies: 2
    Last Post: 2004-12-01, 04:48 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •