+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 15
  1. #1
    Forum Newbie
    Using
    AutoCAD 2013
    Join Date
    Jan 2014
    Posts
    3

    Default Adding something to every layout

    Registered forum members do not see this ad.

    Hi all,

    I have about 140 layouts and I've just been asked to add a piece of information (some mtext) to every other layout, any ideas?

    Any help is appreciated,

    Dave

  2. #2
    Luminous Being RobDraw's Avatar
    Using
    MEP 2017
    Join Date
    Apr 2007
    Location
    Connecticut, USA
    Posts
    5,169

    Default

    Copy and paste is probably the fastest way. You could also use an XREF or a block.

    If this is something that you will be doing on a regular basis, then you might be able to get someone to write some code for you that will insert something into selected layouts.
    Drafting is a breeze.

  3. #3
    Forum Deity rkent's Avatar
    Computer Details
    rkent's Computer Details
    Operating System:
    WIN7 PRO 64bit
    Computer:
    Dell OptiPlex 7020
    CPU:
    i7 4790 3.6GHz
    RAM:
    16GB, 1600MHz, DDR3 non-ECC 2x8GB
    Graphics:
    AMD Radeon 2GB
    Primary Storage:
    Samsung 480Gb SSD
    Monitor:
    Dell 24" FS (2x)
    Discipline
    Mechanical
    rkent's Discipline Details
    Occupation
    Facilities Design - Semi-conductor manufacturing
    Discipline
    Mechanical
    Details
    Designer: Process Piping, P&ID's, Machine Part Design, Planning / General Arrangement. Facilities Management. Drafting: Electrical, Controls, Architectural.
    Using
    Mechanical 2017
    Join Date
    Nov 2007
    Location
    Lat:35, Long:-106, Elev: 5164'
    Posts
    4,579

    Default

    Make that piece of information a .dwg file and xref it into your files. It is likely to change and then you only have to change it once rather than open 140 drawings/layouts.

    Are you saying you have one file with 140 layouts?
    Sometimes there's a man... I won't say a hero, 'cause, what's a hero? But sometimes, there's a man. And I'm talkin' about the Dude here. Sometimes, there's a man, well, he's the man for his time and place. He fits right in there. And that's the Dude, in Los Angeles. - The Stranger, The Big Lebowski

  4. #4
    Senior Member ROBP's Avatar
    Computer Details
    ROBP's Computer Details
    Operating System:
    WINDOWS 10 PRO
    Computer:
    Eurocom
    CPU:
    IINTEL i7-6700K- 4.00GHz
    RAM:
    64 GB
    Graphics:
    K5100M
    Primary Storage:
    1 TB
    Secondary Storage:
    1 TB
    Monitor:
    N/A
    Discipline
    P&ID
    ROBP's Discipline Details
    Occupation
    Powerhouse designer
    Discipline
    P&ID
    Using
    MEP 2018
    Join Date
    Oct 2013
    Location
    Montreal, Canada
    Posts
    344

    Default

    Quote Originally Posted by rkent View Post
    Make that piece of information a .dwg file and xref it into your files. It is likely to change and then you only have to change it once rather than open 140 drawings/layouts.

    Are you saying you have one file with 140 layouts?
    If drawing layout was done with dwt then updating the dwt should do it would it?
    Creativity is intelligence having fun

  5. #5
    Luminous Being RobDraw's Avatar
    Using
    MEP 2017
    Join Date
    Apr 2007
    Location
    Connecticut, USA
    Posts
    5,169

    Default

    Nope.

    If the layout was done with an XREF, that would do it, except for the ones you don't want to see.
    Drafting is a breeze.

  6. #6
    Luminous Being
    Using
    Civil 3D 2016
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    9,882

    Default

    Looping through layouts is easy this is not tested but should work

    Code:
    (setq doc (vla-get-activedocument (vlax-get-acad-object)))
    (vlax-for lay (vla-get-Layouts doc)
    (setvar "ctab" (vla-get-name lay))
    (command "pspace")
    do your thing here insert block of mtext ?
    )
    A man who never made mistakes never made anything

  7. #7
    Forum Newbie
    Using
    AutoCAD 2013
    Join Date
    Jan 2014
    Posts
    3

    Default

    Thanks all, I bit the bullet and just copied and pasted with base points.

    I did try that script but had no joy.

    And yeah just over 140 layouts in one file. Big Project time.

  8. #8
    Luminous Being BlackBox's Avatar
    Computer Details
    BlackBox's Computer Details
    Operating System:
    Windows 8.1 Professional, Server 2012 R2 Datacenter
    Computer:
    Dell Precision T3600
    CPU:
    Hex-Core Intel Xeon 3.2Ghz
    RAM:
    32GB
    Graphics:
    3GB NVIDIA Quadro K4000
    Primary Storage:
    2 x 240GB Samsung EVO SSD (RAID 0)
    Secondary Storage:
    1TB Western Digital VelociRaptor 10K RPM
    Monitor:
    Dual 24" Dell Ultrasharp Widescreen Monitors
    Discipline
    Civil
    BlackBox's Discipline Details
    Occupation
    Senior Civil Designer
    Discipline
    Civil
    Details
    Public/Private Land Development, Transportation, and Utilities.
    Using
    Civil 3D 2016
    Join Date
    Nov 2009
    Posts
    5,282

    Default

    Quote Originally Posted by MiningDave View Post
    Thanks all, I bit the bullet and just copied and pasted with base points.

    I did try that script but had no joy.

    And yeah just over 140 layouts in one file. Big Project time.
    I _really_ wish I had seen this earlier... The only thing _slower_ than performing this task manually, is saving and closing the drawing after you perform this task in each layout manually.

    Short of coding this in either .NET, or ObjectARX APIs (which would be faster), this is about as fast as you can get... No changing the active layout (CTAB), active Viewports are a non-issue, and supports UNDO functionality :

    Code:
    (vl-load-com)
    
    (defun c:CopyToAllLayouts (/ *error* layouts acDoc objects)
    
      (defun *error* (msg)
        (if acDoc
          (vla-endundomark acDoc)
          )
        (cond ((not msg))                                                   ; Normal exit
              ((member msg '("Function cancelled" "quit / exit abort")))    ; <esc> or (quit)
              ((princ (strcat "\n** Error: " msg " ** ")))                  ; Fatal error, display it
        )
        (princ)
      )
    
      (if (= 1 (getvar 'cvport))
        (progn
          (prompt "\nSelect object(s) to copy to all Layouts: ")
          (princ)
          (if (ssget "_:L")
            (progn
              (setq layouts (list "Model" (getvar 'ctab)))
              (vla-startundomark
                (setq acDoc (vla-get-activedocument (vlax-get-acad-object)))
              )
              (vlax-for x (vla-get-activeselectionset acDoc)
                (setq objects (cons x objects))
              )
              (vlax-for layout (vla-get-layouts acDoc)
                (if (not (vl-position (vla-get-name layout) layouts))
                  (vlax-invoke
                    acDoc
                    'copyobjects
                    objects
                    (vla-get-block layout)
                  )
                )
              )
            )
          )
        )
        (prompt "\n** Command not available in Model Tab ** ")
      )
    
      (*error* nil)
    )

    Cheers



    [Edit] - I'd be very interested to know approximately how long it took you to do manually, as compared to how long this option takes?
    "Potential has a shelf life." - Margaret Atwood
    AutoCAD, and Civil 3D Certified Professional | Autodesk Authorized Developer
    Sincpac C3D ~ Exchange Apps ~ Autoloader ~ AutoCAD Security

  9. #9
    Luminous Being BlackBox's Avatar
    Computer Details
    BlackBox's Computer Details
    Operating System:
    Windows 8.1 Professional, Server 2012 R2 Datacenter
    Computer:
    Dell Precision T3600
    CPU:
    Hex-Core Intel Xeon 3.2Ghz
    RAM:
    32GB
    Graphics:
    3GB NVIDIA Quadro K4000
    Primary Storage:
    2 x 240GB Samsung EVO SSD (RAID 0)
    Secondary Storage:
    1TB Western Digital VelociRaptor 10K RPM
    Monitor:
    Dual 24" Dell Ultrasharp Widescreen Monitors
    Discipline
    Civil
    BlackBox's Discipline Details
    Occupation
    Senior Civil Designer
    Discipline
    Civil
    Details
    Public/Private Land Development, Transportation, and Utilities.
    Using
    Civil 3D 2016
    Join Date
    Nov 2009
    Posts
    5,282

    Default

    Quote Originally Posted by BlackBox View Post
    [Edit] - I'd be very interested to know approximately how long it took you to do manually, as compared to how long this option takes?
    I just bench tested this on a drawing with 140 layouts, copying 104 circles (an exploded 8 x 13 array) to each layout, and it only took +/- 3 seconds... _Including_ the time it took me to select the circles to copy:

    Code:
    Command: (length (layoutlist))
    140
    
    Command: (bench '(c:foo) '() 1)
    
    C:FOO
    Select object(s) to copy to all Layouts: 104 found
    
    Elapsed: 2610
    Average: 2610.0000


    Cheers
    "Potential has a shelf life." - Margaret Atwood
    AutoCAD, and Civil 3D Certified Professional | Autodesk Authorized Developer
    Sincpac C3D ~ Exchange Apps ~ Autoloader ~ AutoCAD Security

  10. #10
    Luminous Being
    Using
    Civil 3D 2016
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    9,882

    Default

    Registered forum members do not see this ad.

    I agree 140 to slow manually.

    A question Blackbox most of my layout stuff requires the use of 'CTAB using the vlax-invoke can you update a attributed block "Titleblock" with out having to go to that layout and force a display ? Thats the time killer mind you 89 layouts takes about max 1 min to do lots of stuff ?
    A man who never made mistakes never made anything

Similar Threads

  1. Move layout-Rename layouts- Goto layout
    By BIGAL in forum AutoCAD Drawing Management & Output
    Replies: 2
    Last Post: 22nd Apr 2014, 01:30 am
  2. How to change 2009's layout to a "classical layout"?
    By Zzap in forum AutoCAD Beginners' Area
    Replies: 6
    Last Post: 2nd Apr 2011, 02:23 am
  3. moved from one layout to another layout
    By yadavdinesh2008 in forum AutoCAD Beginners' Area
    Replies: 1
    Last Post: 6th Jun 2010, 05:02 pm
  4. Adding template to layout.
    By jeremyjjbrown in forum AutoCAD Beginners' Area
    Replies: 7
    Last Post: 30th Jan 2010, 12:55 am
  5. Adding the Layout Name via Fields to a Title Block
    By HyperPics in forum AutoCAD RSS Feeds
    Replies: 0
    Last Post: 3rd Feb 2007, 02:40 am

Tags for this Thread

Bookmarks

Posting Permissions

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