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:
LISP HELP - Combine functions into single COMMAND
« previous
next »
Print
Pages: [
1
] |
Go Down
Author
Topic: LISP HELP - Combine functions into single COMMAND (Read 1475 times)
0 Members and 1 Guest are viewing this topic.
aswin
Mosquito
Posts: 12
LISP HELP - Combine functions into single COMMAND
«
on:
June 07, 2017, 01:07:14 AM »
Hi friends .. I am posting a lisp here... this lisp functions are 'CURRENT LAYOUT SETUP TO ALL LAYOUT TABS' and 'PRINT ALL LAYOUTS TABS' .
but i have to enter two comments ,
CPS='CURRENT LAYOUT SETUP TO ALL LAYOUT TABS'
PT ='PRINT ALL LAYOUTS TABS'
can we make this into a single command for both functions?
-----------------------------------------------------------------------------------------------------------------------------------------------------------
Code - Auto/Visual Lisp:
[Select]
;; Copy current layout page setup to all layout tabs
(
vl-load-com
)
(
defun
c:CPS
(
/
Adoc Layts clyt
)
(
setq
aDoc
(
vla-get-activedocument
(
vlax-get-acad-object
)
)
Layts
(
vla-get-layouts
aDoc
)
clyt
(
vla-get-activelayout
aDoc
)
)
(
foreach
itm
(
vl-remove
(
vla-get-name
clyt
)
(
layoutlist
)
)
(
vla-copyfrom
(
vla-item
Layts itm
)
clyt
)
)
(
princ
)
)
(
Defun
C:PT
(
/
PLO_LAYOUTS PLO_CNTR PLO_LIST PLO_LAYOUTTAB
)
(
vl-load-com
)
(
setvar
"FILEDIA"
0
)
(
setvar
"CMDDIA"
0
)
(
initget
6
)
; disallow 0 or <0
(
setq
nofs
(
getint
"Enter number of sets: <1>"
)
)
(
setq
nofs
(
if
(
or
nofs
(
=
nofs
0
)
)
nofs
1
)
)
(
setq
PLO_LAYOUTS
(
vla-get-layouts
(
vla-get-activedocument
(
vlax-get-acad-object
)
)
)
)
(
vlax-for
PLO_LAYOUT PLO_LAYOUTS
(
setq
plo_list
(
cons
(
vla-get-name
PLO_LAYOUT
)
plo_list
)
)
)
(
setq
PLO_LIST
(
reverse
PLO_LIST
)
)
(
while
(
>=
nofs
1
)
(
setq
plo_cntr
0
)
(
repeat
(
1-
(
length
plo_list
)
)
; plot all but MODEL
(
setq
PLO_LAYOUTTAB
(
nth
PLO_CNTR PLO_LIST
)
)
(
command
"-PLOT"
"n"
PLO_LAYOUTTAB
""
""
""
""
""
""
)
(
setq
PLO_CNTR
(
1+
PLO_CNTR
)
)
)
(
prompt
"
\n
Plot Set Complete"
)
(
setq
nofs
(
1-
nofs
)
)
)
(
setvar
"FILEDIA"
1
)
(
setvar
"CMDDIA"
1
)
(
princ
)
)
Edit kdub : changed Subject title to be descriptive.
add code tags
«
Last Edit: June 07, 2017, 04:02:32 AM by kdub
»
Logged
Abu Dhabi
kdub_nz
Mesozoic keyThumper
SuperMod
Water Moccasin
Posts: 2142
class keyThumper<T>:ILazy<T>
Re: LISP HELP - Combine functions into single COMMAND
«
Reply #1 on:
June 07, 2017, 04:54:52 AM »
You could try something like :
Code - Auto/Visual Lisp:
[Select]
(
defun
c:CPS
-
PT
(
)
(
c:CPS
)
(
c:PT
)
(
princ
)
)
Logged
Called Kerry in my other life
Retired; but they dragged me back in !
I live at UTC + 13.00
---
some people complain about loading the dishwasher.
Sometimes the question is more important than the answer.
aswin
Mosquito
Posts: 12
Re: LISP HELP - Combine functions into single COMMAND
«
Reply #2 on:
June 07, 2017, 05:02:16 AM »
@kdub
thank you soo much...
Logged
Abu Dhabi
Print
Pages: [
1
] |
Go Up
« previous
next »
TheSwamp
»
Code Red
»
AutoLISP (Vanilla / Visual)
»
Topic:
LISP HELP - Combine functions into single COMMAND