Results 1 to 8 of 8

Thread: Importing Page Setups

  1. #1
    Wish List Manager BrenBren's Avatar
    Join Date
    2000-11
    Location
    150700
    Posts
    3,439
    Login to Give a bone
    0

    Default Importing Page Setups

    This used to work. I added an additional pagesetup to my file "plottest.dwg", and now this doesn't work. I can't figure out why.

    Code:
    (defun C:PSU (/ O_cmdecho)
    
      (setq O_cmdecho (getvar "cmdecho"))
      (setvar "cmdecho" 0)
      (setq expert (getvar "EXPERT")) (setvar "EXPERT" 2) 
    
    
      ; delete all existing page setups
      
      (vl-load-com)
      (vlax-for ps
            (vla-get-plotconfigurations
              (vla-get-activedocument
            (vlax-get-acad-object)
            )
              )
        (vla-delete ps)
        )
    
    
      ; import all pagesetups from plottest
      
    (command "._-PSETUPIN" "plottest.dwg" "*")
    
    
    
    
      (setvar "cmdecho" )_cmdecho
      (setvar "expert" expert)
      (princ)
      )

  2. #2
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    6,420
    Login to Give a bone
    0

    Default Re: Importing Page Setups

    Please clarify what you mean by 'this doesn't work' and list any errors.
    C:> ED WORKING....


    LinkedIn

  3. #3
    Certifiable AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL USA
    Posts
    3,667
    Login to Give a bone
    0

    Default Re: Importing Page Setups

    As best I can remember I've never been able to delete a page setup assigned to a layout or overwrite an existing page setup.
    Since you don't include the path to "plottest.dwg" have you tried using that command at the command line instead to see if it works or not?
    I've always used Lee Mac's Steal from Drawing code to import layouts and page setups with one lsp call.
    Code:
    ^C^C^P(DelPageSetup "11×17*")(Steal (strcat (vl-filename-directory (getenv "QnewTemplate")) (chr 92) "AutoCAD Template" (chr 92) "Templates.dwt") (list (list "Page Setups" (list "11×17" "11×17 PDF"))(list "Layouts" (list "11×17")))) .regen
    I have different macros for different sizes and for cover sheets as well.
    This may help: https://forums.autodesk.com/t5/visua...450956#M343122

  4. #4
    Wish List Manager BrenBren's Avatar
    Join Date
    2000-11
    Location
    150700
    Posts
    3,439
    Login to Give a bone
    0

    Default Re: Importing Page Setups

    I will have to check this out.

    I know this has worked in the past (I used it to update old drawings when we changed our plotter names).

    In any case, I did use the command at the command line, and because it seems to default to the last place you importated a page setup from, it does work.

    I will check out those links; thanks.

    - - - Updated - - -

    It's simply not changing anything. There is no error code, just doesn't change the pagesetups like it used to.

  5. #5
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    6,420
    Login to Give a bone
    0

    Default Re: Importing Page Setups

    Quote Originally Posted by BrenBren View Post
    It's simply not changing anything. There is no error code, just doesn't change the pagesetups like it used to.
    I have a NET solution for page setups. It creates two commands. One configures your preferences for the second command. A single click on the second command does the imports. Let me package it for you.
    C:> ED WORKING....


    LinkedIn

  6. #6
    Certifiable AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL USA
    Posts
    3,667
    Login to Give a bone
    0

    Default Re: Importing Page Setups

    You probably already have a page setup with the same name assigned to a layout. You cannot override an existing page setup with lisp, as far as I know but you can import a different page setup and assign it to those layouts with lisp, delete the page setup then save and try your code again.

    Have you tried it on a drawing that doesn't have that page setup already?

  7. #7
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    6,420
    Login to Give a bone
    0

    Default Re: Importing Page Setups

    Quote Originally Posted by Ed Jobe View Post
    I have a NET solution for page setups. It creates two commands. One configures your preferences for the second command. A single click on the second command does the imports. Let me package it for you.
    Hi Brenda, here is a bundle of my solution. Just right click on the zip and select Properties, then UNBLOCK. Now extract it and move that folder to %APPDATA%/Autodesk/ApplicationPlugins
    Attached Files Attached Files
    Last edited by Ed Jobe; 2022-12-21 at 08:24 PM.
    C:> ED WORKING....


    LinkedIn

  8. #8
    Administrator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,719
    Login to Give a bone
    0

    Default Re: Importing Page Setups

    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000

Similar Threads

  1. 2016: Page Setup Manager/Page Setups not importing
    By tbevis730888 in forum AutoCAD General
    Replies: 2
    Last Post: 2016-07-02, 03:49 PM
  2. importing page setups
    By rstiles in forum AutoCAD General
    Replies: 10
    Last Post: 2007-08-16, 10:23 PM
  3. Importing Page Setups
    By hostetterkl in forum AutoLISP
    Replies: 4
    Last Post: 2005-08-19, 10:23 PM
  4. Missing Page Setups in Page Setup Override
    By footprint_arch in forum AutoCAD Sheet Set Manager
    Replies: 2
    Last Post: 2005-06-15, 08:41 PM
  5. Importing a layout also imports the named page setups
    By jpaulsen in forum AutoCAD Wish List
    Replies: 1
    Last Post: 2005-02-17, 04:29 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
  •