Author Topic: Adding a psetup from a script or through a lisp in a script  (Read 3051 times)

0 Members and 1 Guest are viewing this topic.

Andrew H

  • Guest
Adding a psetup from a script or through a lisp in a script
« on: August 10, 2004, 11:23:08 AM »
Is there a way to add a pagesetup through a script? Or even through a lisp in a script?

hudster

  • Gator
  • Posts: 2848
Adding a psetup from a script or through a lisp in a script
« Reply #1 on: August 10, 2004, 11:50:26 AM »
psetupin

create a drawing with the required page setup, save it and use this command to load it's page setups into the current drawing.
Revit BDS 2017, 2016, 2015, 2014, AutoCAD 2017, 2016, Navisworks 2017, 2016, BIM360 Glue

M-dub

  • Guest
Adding a psetup from a script or through a lisp in a script
« Reply #2 on: August 10, 2004, 11:51:33 AM »
This is in a cutom button of mine...I'm sure you could do it in a script though...
^C^CDel_Pagesetups;^C^C.-PSETUPIN "O:/Drawings/SupportforCAD/AutoCAD-2004-Support/PageSetups.dwg" "*" PLOT;

Here's the Del_Pagesetups routine...
Code: [Select]
;;  Function to delete all user plot set ups
(defun c:Del_Pagesetups (/ curdwg pslayout x)
  (vl-load-com)
  (setq
    curdwg   (vla-get-ActiveDocument (vlax-get-Acad-Object))
    pslayout (vla-get-Layout (vla-get-PaperSpace curdwg))
  ) ;_ end of setq
  ;; Call RefreshPlotDeviceInfo before GetPlotDeviceNames
  (vla-RefreshPlotDeviceInfo pslayout)
  (vlax-for x (vla-get-Plotconfigurations curdwg)
    (vla-delete x)
  ) ;_ end of vlax-for
)               ; End Plot_config_list
(c:Del_Pagesetups)

Andrew H

  • Guest
Adding a psetup from a script or through a lisp in a script
« Reply #3 on: August 10, 2004, 11:56:24 AM »
Thanks guys, I'll let you know how it goes.

Andrew H

  • Guest
Adding a psetup from a script or through a lisp in a script
« Reply #4 on: August 10, 2004, 12:12:10 PM »
Ok, here's the script file...

Code: [Select]
-cdgpurge
p
-psetupin
;enter your default drawing location including drawing name here
;enter your page setup name here (one word pagesetup names work best)



This one is using the CDG Purge for deleting all previous pagesetups, but you can use an existing lisp you have or not include that protion of the script by deleting the first 2 lines of text from the script file.

Andrew H

  • Guest
Adding a psetup from a script or through a lisp in a script
« Reply #5 on: August 10, 2004, 12:21:25 PM »
One thing I forgot to say...

when entering your default drawing location and name be sure to add " at the beginning and the end of the file location.

Example: "C:/Current Project/Current Drawing.dwg"