Pretty sure I sent you this. You marked that one as answered so I did not bother doing more.
Here
(command "._-PSETUPIN" "x:\\xx\\Page Setups.dwg" "3624 PDF")
Is the dwg your pulling from
3624 pdf is the plot setup.
(if (= (strcase "3624 PDF") (strcase (vla-get-name x)))
puts the 3624 pdf as the page setup.
;;; ==============================================================================
;;; Lisp Name: foo.lsp
;;; Author: Lonnie
;;; Date Created: 2024-07-02
;;; Last Edited: [Insert Last Edit Date]
;;;
;;; DESCRIPTION:
;;; A routine to set up page configurations by importing them from a specified DWG file.
;;;
;;; Usage:
;;; 1. Load the Lisp routine.
;;; 2. Run the command "foo" in AutoCAD.
;;;
;;; Parameters:
;;; None explicitly, but internally uses the DWG path and page setup name.
;;;
;;; Returns:
;;; None
;;;
;;; Notes:
;;; - This routine imports the "3624 PDF" page setup from the specified DWG file
;;; ("x:\\xx\\Page Setups.dwg") and applies it to the current drawing.
;;;
;;; Related URL:
;;; https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/copy-objects-in-one-dwg-files-with-lots-of-layouts-sheets/td-p/12949888
;;; https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/set-a-page-setup-current-with-lsp/td-p/12917953
;;;
;;; ---------------------------- Main Program --------------------------------
(defun C:foo ()
(command "._-PSETUPIN" "x:\\xx\\Page Setups.dwg" "3624 PDF")
(vlax-for x
(vla-get-plotconfigurations
(setq d (vla-get-activedocument (vlax-get-acad-object))))
(if (= (strcase "3624 PDF") (strcase (vla-get-name x)))
(vl-catch-all-apply 'vla-copyfrom (list (vla-get-activelayout d) x))
)
)
)