bicok
Guest
Hello, everyone! I've been dating for a few weeks because I started an internship and asked me exact things... it's been years that I haven't been using autocad and immediately I've been reluctant. but the use of things like lisp or similar (I made geometries, I had the lt version therefore neither existed), pushed me to do research and most times, to ask you.
the problem that I had to solve I identified in many discussions, all similar as question but with very different answers between them, even within the same... doing a collage of everything, proceeding little bit after little bit I stood up small questions for which I did not create posts on purpose, only to receive a two-line answer... and so I got in private contact with some users that han gave me exhaustive answers
Now that I finished the program, I wanted to post it, absolutely not to "short it", but because, as I said before, it is something I read many questions, and I thought to explain how to proceed to use the lisp starting from scratch, as 2 weeks ago I would have hoped to read about it
this lisp is used to print a large amount of sheets, having the same size and willing to equal distance from each other. once you start, the only things you ask will be:
insert first edge of the first sheet
insert second edge at the top of the first sheet
# Of sheets to print
distance between a final edge and the next initial of the cartiglio after
After that he begins and there is no need to do anything. it will open in sequence all pdf files sorted with names 0.pdf to grow . then it will be enough to have a program that unites pdf and you will create a single one, ready to be printed or peeled comfortably
how to make file lisp:
open note block, insert this text:
;; print one table at a time, print from the first selected sheet! ! ! ! !
(defun c:abc( / pt1 pt2 n m k cont pt1x pt1y pt2x pt2y base)
(setq pt1 (getpoint "\n selects the first edge at the bottom left of the first pane"))
(setq pt2 (getpoint "\n selects the second upper right corner of the first pane"))
(setq n (getint "\n how many elements there are to print")
(setq m (- n 1))
(setq k (getreal "\n what is the distance between the last edge of a frame and the next first edge"))
(command "print" "si" "model" "dwg to pdf.pc3" "iso a4 (210 x 297 mm)" "millimeters" "horizontal" "no" "window"
pt1 pt2 "suitable" "center" "yes" ". "yes" "c" 0 "n" "yes" "")
(setq cont)
(repeat m)
(setq pt1x (car pt1))
(setq pt1y (cadr pt1))
(setq pt2x (car pt2))
(setq pt2y (cadr pt2))
(setq base (- pt2x pt1x))
(setq pt1x (+ base k pt1x))
(setq pt2x (+ base k pt2x))
(setq pt1 (list pt1x pt1y))
(setq pt2 (list pt2x pt2y))
(command "print" "si" "model" "dwg to pdf.pc3" "iso a4 (210 x 297 mm)" "millimeters" "horizontal" "no" "window"
pt1 pt2 "suitable" "center" "yes" ". "yes" "c" cont "n" "yes" "")
(setq cont (+ cont 1))
)
)
save it in autocad folder with .lsp extension (e.g.lsp)
then open autocad and launch the lisp from the button with the command
(load "es")
write
abc (name given by case)
and complete the fields required
hello and thanks again to all for giving me support by mail and I hope I'm planning is useful to everyone, or to people who, like me, up to two weeks ago, did not know/know the existence of this very useful language, but who placed this problem of multiple printing
ps: obviously, changing the "command ...." you can also print on printer or via other
the problem that I had to solve I identified in many discussions, all similar as question but with very different answers between them, even within the same... doing a collage of everything, proceeding little bit after little bit I stood up small questions for which I did not create posts on purpose, only to receive a two-line answer... and so I got in private contact with some users that han gave me exhaustive answers
Now that I finished the program, I wanted to post it, absolutely not to "short it", but because, as I said before, it is something I read many questions, and I thought to explain how to proceed to use the lisp starting from scratch, as 2 weeks ago I would have hoped to read about it
insert first edge of the first sheet
insert second edge at the top of the first sheet
# Of sheets to print
distance between a final edge and the next initial of the cartiglio after
After that he begins and there is no need to do anything. it will open in sequence all pdf files sorted with names 0.pdf to grow . then it will be enough to have a program that unites pdf and you will create a single one, ready to be printed or peeled comfortably
how to make file lisp:
open note block, insert this text:
;; print one table at a time, print from the first selected sheet! ! ! ! !
(defun c:abc( / pt1 pt2 n m k cont pt1x pt1y pt2x pt2y base)
(setq pt1 (getpoint "\n selects the first edge at the bottom left of the first pane"))
(setq pt2 (getpoint "\n selects the second upper right corner of the first pane"))
(setq n (getint "\n how many elements there are to print")
(setq m (- n 1))
(setq k (getreal "\n what is the distance between the last edge of a frame and the next first edge"))
(command "print" "si" "model" "dwg to pdf.pc3" "iso a4 (210 x 297 mm)" "millimeters" "horizontal" "no" "window"
pt1 pt2 "suitable" "center" "yes" ". "yes" "c" 0 "n" "yes" "")
(setq cont)
(repeat m)
(setq pt1x (car pt1))
(setq pt1y (cadr pt1))
(setq pt2x (car pt2))
(setq pt2y (cadr pt2))
(setq base (- pt2x pt1x))
(setq pt1x (+ base k pt1x))
(setq pt2x (+ base k pt2x))
(setq pt1 (list pt1x pt1y))
(setq pt2 (list pt2x pt2y))
(command "print" "si" "model" "dwg to pdf.pc3" "iso a4 (210 x 297 mm)" "millimeters" "horizontal" "no" "window"
pt1 pt2 "suitable" "center" "yes" ". "yes" "c" cont "n" "yes" "")
(setq cont (+ cont 1))
)
)
save it in autocad folder with .lsp extension (e.g.lsp)
then open autocad and launch the lisp from the button with the command
(load "es")
write
abc (name given by case)
and complete the fields required
hello and thanks again to all for giving me support by mail and I hope I'm planning is useful to everyone, or to people who, like me, up to two weeks ago, did not know/know the existence of this very useful language, but who placed this problem of multiple printing
ps: obviously, changing the "command ...." you can also print on printer or via other