Commandobill Posted October 31, 2008 Posted October 31, 2008 Hello. At my company we created an autolisp program to print multiple layouts a certain way. The only thing we havent done is figured out how we can get the program to recognize whether the layout is portrait or landscape. I was wondering if anyone has written a program to recieve that information. Quote
CmdrDuh Posted October 31, 2008 Posted October 31, 2008 you can use min/max to figure it out. (calc LL to UR, then compare the deltaX and deltaY, which ever is greater, use the correct paper rotation) i dont use LISP much, but if you post what you have, Im sure somebody can add to what you have Quote
Commandobill Posted October 31, 2008 Author Posted October 31, 2008 i guess then the question is how do i get the points of the ll and ur? From there the lisp would be quite simple Quote
borgunit Posted October 31, 2008 Posted October 31, 2008 Here are some of my base code modules. May help.. Be sure to add (vl-load-com) in your code. ;------------------------------------------------------------------------------ ;pp_GetCurrPlotRotation: ;------------------------------------------------------------------------------ (defun pp_GetCurrPlotRotation() (vla-get-plotrotation (pp_GetActiveLayout)) ) ;------------------------------------------------------------------------------ ;pp_GetActiveLayout: Returns active layout object ;------------------------------------------------------------------------------ (defun pp_GetActiveLayout () (vla-get-ActiveLayout (pp_GetActiveDocument)) ) ;------------------------------------------------------------------------------ ;pp_GetActiveDocument: Returns active AutoCAD drawing document object ;------------------------------------------------------------------------------ (setq *active-document* nil) ; Initialize global variable (defun pp_GetActiveDocument () (cond (*active-document*) ; Return the cached object (T (setq *active-document* (vla-Get-ActiveDocument (pp_GetAcadObject))) ) ) ) ;------------------------------------------------------------------------------ ;pp_GetAcadObject: Returns active AutoCAD object ;------------------------------------------------------------------------------ (setq *acad-object* nil) ; Initialize global variable (defun pp_GetAcadObject () (cond (*acad-object*) ; Return the cached object (T (setq *acad-object* (vlax-Get-Acad-Object)) ) ) ) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.