HOW TO GET REAL PRINTABLE SIZE per LAYOUT via lisp?

HOW TO GET REAL PRINTABLE SIZE per LAYOUT via lisp?

Anonymous
Not applicable
741 Views
3 Replies
Message 1 of 4

HOW TO GET REAL PRINTABLE SIZE per LAYOUT via lisp?

Anonymous
Not applicable
 
0 Likes
742 Views
3 Replies
Replies (3)
Message 2 of 4

phanaem
Collaborator
Collaborator

Hi

Try this one.

Works ok for metric settings. For imperial, it seems to work, but I've made just a single test.

 

(defun c:test (/ lo wdt lg ll ur plotarea)
  (vl-load-com)
  (vlax-for lo (vla-get-layouts (vla-get-activedocument (vlax-get-acad-object)))
    (vla-getpapersize lo 'wdt 'lg)
    (vla-getpapermargins lo 'll 'ur)
    (setq plotarea (mapcar '- (list wdt lg) (vlax-safearray->list ll) (vlax-safearray->list ur)))
    (if
      (zerop (vla-get-paperunits lo))
      (setq plotarea (mapcar '/ plotarea '(25.4 25.4)))
      )
    (princ "\n")
    (princ (vla-get-name lo))
    (princ "\n\t\tPlot size - ")
    (princ
      (if
        (zerop (rem (vla-get-plotrotation lo) 2))
        plotarea
        (reverse plotarea)
      )
    )
  )
  (textscr)
  (princ)
)

 

0 Likes
Message 3 of 4

Anonymous
Not applicable

First of all, thank you for your quick answer, but I see some problems in your routine..

The main problem: program returns not Real printable sizes.. real sizes much less because plotter remove top and bottom blank areas from layout when makes plot.

In fact I need these "netto" sizes without any blank areas.

Do you now an appropriate solution for this problem?

0 Likes
Message 4 of 4

phanaem
Collaborator
Collaborator
I'm afraid that decision to plot or not the top and the bottom blank area is made at the printing time and it is an instruction sent to the printer. It is a printing device setting, not an autocad setting.
Someone could make a selection set of all objects within plot area, calculate the boundingbox of all and compare to printing settings and device settings, but this would be very complicated. I would not venture to a job like this.
0 Likes