Dear autocad users, auto-,vlisp writers,
Might i ask your help.
I would like to create a lisp that "automatically" plots all present layouts.
I've written the following and it works if the plot setting are equal in every layout.
The only problem is.. Not all the layouts are equal.
I want to add a kind of “page orientation recognizer” that will tell alter the lisp-route
To check Portrait orientated layout sizes.
The only problem is… It does not keep in consideration the differences in the layouts. Differences like Page Orientation or Size.
I would really like to add this “consideration”.
I've tried to solve my little problem... but i still lack the proper knowlage of good autolisp coding.
could you please help me?
Manny thanks in advance.
Greets Michel
I’ve written the following code:
(defun c:tolp (/ ) (setq hhmax (car (getvar "limmax"))) ; X-Limits (setq vvmax (cadr (getvar "limmax"))) ; Y-Limmits ; Get page orientation. (vl-load-com)(setq rot (vla-get-plotrotation (vla-get-activelayout (vla-get-activedocument (vlax-get-acad-object))))) ;Set $var ROT, to sting. (setq rot (itoa rot) ; Start the If-statements to check page size, if landscape (or that is the idea) (if (= rot 1);true run next if statements... (if (< hhmax 400) ; true (setq plotsize "A4") ; True ) (if (> hhmax 400) ; True A3 (setq plotsize "A3") ; True ) (if (> hhmax 500) ; True A2 (setq plotsize "A2") ) (if (> hhmax 800) ; True A1 (setq plotsize "A1") ) (if (> hhmax 1000) ; True A0 (setq plotsize "A0") ) (princ “\nNo correct papersize found! ”) ;accept for this part… the lisp works ;Portrait ;If page orientation is 0 or Portrait run the following If-statements) (setq orientation portrait) (if (< hhmax 250) ; True (setq plotsize "A4") ) (if (> hhmax 250) ; True (setq plotsize "A3") ) (if (> hhmax 300) ; True (setq plotsize "A2") ) (if (< hhmax 500) ; True (setq plotsize "A1") ) (if (< hhmax 800) ; True (setq plotsize "A0") ) (Princ ”Digital input failed, please resort to manual input.” ) ) )