Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
Home
Help
Login
Register
TheSwamp
»
Code Red
»
AutoLISP (Vanilla / Visual)
»
Topic:
Select ONLY Layout's Page Sets
« previous
next »
Print
Pages: [
1
] |
Go Down
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.
Logged
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]
(
defun
allps
(
/
aps
)
;; You need to create a list of plotconfigurations not a selection set
;;(setq aps (ssadd))
(
vlax-for
pc
(
vla-get-plotconfigurations
(
vla-get-activedocument
(
vlax-get-acad-object
)
)
)
(
if
(
=
(
vla-get-modeltype
pc
)
:vlax-false
)
(
setq
aps
(
cons
pc aps
)
)
)
)
;; Return the value
aps
)
(
if
(
allps
)
(
mapcar
'
vla-get-name
(
allps
)
)
)
Logged
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".
Logged
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?
Logged
Windows 11 x64 - AutoCAD /C3D 2023
Custom Build PC
tombu
Bull Frog
Posts: 289
ByLayer=>Not0
Re: Select ONLY Layout's Page Sets
«
Reply #4 on:
July 03, 2018, 03:04:42 PM »
See also:
http://forums.augi.com/showthread.php?172048-Select-ONLY-Layout-s-Page-Sets&p=1336601#post1336601
Logged
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
Logged
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.
Logged
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.
Logged
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
Logged
Windows 11 x64 - AutoCAD /C3D 2023
Custom Build PC
Print
Pages: [
1
] |
Go Up
« previous
next »
TheSwamp
»
Code Red
»
AutoLISP (Vanilla / Visual)
»
Topic:
Select ONLY Layout's Page Sets