Results 1 to 2 of 2

Thread: Applying Script To Multiple layouts problem?

  1. #1
    Member pierredib's Avatar
    Join Date
    Login to Give a bone

    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
    Jo'burg SA
    Login to Give a bone

    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):
    ;; 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")
          (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")
    ZOOM E
    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. 2015: AutoCAD LT Script that changes multiple attributes across multiple drawings
    By alecgburke704194 in forum AutoCAD LT - General
    Replies: 1
    Last Post: 2015-06-30, 12:21 PM
  2. 2012: Applying Page setup to all layouts at once
    By Darren Allen in forum AutoCAD General
    Replies: 22
    Last Post: 2013-01-22, 03:15 PM
  3. applying multiple object markers
    By randall.hanes in forum AutoCAD Civil 3D - Sections
    Replies: 0
    Last Post: 2009-10-28, 09:20 PM
  4. Multiple layouts vs Multiple drawing files
    By mmilko.83044 in forum CAD Standards
    Replies: 26
    Last Post: 2009-06-12, 05:15 PM
  5. Multiple script problem
    By DAVIDALLIN in forum AutoCAD General
    Replies: 2
    Last Post: 2004-12-01, 05: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