Author Topic: Select ONLY Layout's Page Sets  (Read 1849 times)

0 Members and 1 Guest are viewing this topic.

Clujna

  • Mosquito
  • Posts: 12
  • Juanjo, draftsman
Select ONLY Layout's Page Sets
« on: July 02, 2018, 07:06:30 AM »
Hi all,
I'm trying to convert this function:

(defun AllPS (/)
  (vla-get-plotconfigurations
    (vla-get-activedocument (vlax-get-acad-object))
  )
)

...to one that returns only the layouts page sets.
I summarize my (fruitless) attempts, based in variations of jtbworld's Pagesetup tools:

(defun AllPS (/ aps)
  (setq aps (ssadd))
  (vlax-for pc (vla-get-plotconfigurations
    (vla-get-activedocument (vlax-get-acad-object)))
    (if (= (vla-get-modeltype pc) :vlax-false)
        (ssadd (vlax-vla-object->ename pc) aps)
    )
  )
)

(defun AllPS (/ aps)
  (setq aps (ssadd))
  (vlax-for pc (vla-get-plotconfigurations
    (vla-get-activedocument (vlax-get-acad-object)))
    (if (= (vla-get-modeltype pc) :vlax-false)
      (ssadd pc aps)
    )
  )
)

I will appreciate any help.
Juan José Bernal, civil works draftsman

ronjonp

  • Needs a day job
  • Posts: 7531
Re: Select ONLY Layout's Page Sets
« Reply #1 on: July 02, 2018, 09:15:30 AM »
Give this a try:
Code - Auto/Visual Lisp: [Select]
  1. (defun allps (/ aps)
  2.   ;; You need to create a list of plotconfigurations not a selection set
  3.   ;;(setq aps (ssadd))
  4.     (if (= (vla-get-modeltype pc) :vlax-false)
  5.       (setq aps (cons pc aps))
  6.     )
  7.   )
  8.   ;; Return the value
  9.   aps
  10. )
  11. (if (allps)
  12.   (mapcar 'vla-get-name (allps))
  13. )

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

Clujna

  • Mosquito
  • Posts: 12
  • Juanjo, draftsman
Re: Select ONLY Layout's Page Sets
« Reply #2 on: July 03, 2018, 04:42:25 AM »
Thank you Mr. Ronjonp, forgive the delay in responding, a lot of work here, besides the hourly difference.
Unfortunately, it does not work. I think it's because of the way he returns the list.

Original function:
Command: (allps)
# <VLA-OBJECT IAcadPlotConfigurations 00000000565eebe8>

Modified function:
Command: (allps)
(# <VLA-OBJECT IAcadPlotConfiguration 000000005e898248>)

The function is within a command published here by Mr. Irné Barnard, whom I have tried to request permission to modify without success. I expect not to be breaking any norm of this forum
http://forums.augi.com/showthread.php?117284-LayoutTools-Explained&highlight=layouttools

In the original command the function is called "Get-Tab-Col".
Juan José Bernal, civil works draftsman

ronjonp

  • Needs a day job
  • Posts: 7531
Re: Select ONLY Layout's Page Sets
« Reply #3 on: July 03, 2018, 09:20:39 AM »
What are you trying to do with this?

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

tombu

  • Bull Frog
  • Posts: 289
  • ByLayer=>Not0
Tom Beauford P.S.M.
Leon County FL Public Works - Windows 7 64 bit AutoCAD Civil 3D

Clujna

  • Mosquito
  • Posts: 12
  • Juanjo, draftsman
Re: Select ONLY Layout's Page Sets
« Reply #5 on: July 04, 2018, 08:55:36 AM »
I want only the paper space page settings to appear in the dialog box, if it's possible. Believe me, I've tried it on my own.
Universal excuses if I am not using absolutely correct the forum.

PD: ...and for my English
Juan José Bernal, civil works draftsman

ronjonp

  • Needs a day job
  • Posts: 7531
Re: Select ONLY Layout's Page Sets
« Reply #6 on: July 05, 2018, 10:33:18 AM »
Maybe THIS is what you need.

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

Clujna

  • Mosquito
  • Posts: 12
  • Juanjo, draftsman
Re: Select ONLY Layout's Page Sets
« Reply #7 on: July 06, 2018, 05:27:16 AM »
Yes Ron, that's exactly it. Many thanks.
I hope to understand someday how it does, apart from using it.

I leave you a written function in my Paleozoic AutoLISP, a clear demonstration that I must continue to improve.
Greetings.
Juan José Bernal, civil works draftsman

ronjonp

  • Needs a day job
  • Posts: 7531
Re: Select ONLY Layout's Page Sets
« Reply #8 on: July 06, 2018, 10:08:25 AM »
That's pretty slick .. thanks for sharing :)

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC