Jump to content

Recommended Posts

Posted

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.

Posted

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

Posted

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

Posted

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))
   )
 )
)

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...