Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

changing vla-put-PlotRotation not always working

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
Anonymous
746 Views, 2 Replies

changing vla-put-PlotRotation not always working

I have written a program to read a list of sheets, build layout tabs, insert title blocks with attributes and then setup the plotter. Until today, all my title blocks where landscape and the title blocks where always the same size in 1 drawing. Now I need to be able to have multiple title block sizes (A, B, C, etc.) and with portrait or landscape rotations and set plot type to extents. I wrote a quick change the values and show settings - (defun C:TEST () (foreach Layout (layoutlist) (setvar "CTAB" Layout) (command "ZOOM" "E") (setq P1 (getvar "EXTMIN")) (setq P2 (getvar "EXTMAX")) (setq AlayObj (vla-get-ActiveLayout (vla-get-ActiveDocument (vlax-get-Acad-Object)))) (setq Rotation (vla-get-PlotRotation AlayObj)) (if (< (abs (- (car P2) (car P1))) (abs (- (cadr P2) (cadr P1)))) (progn (vla-put-PlotRotation AlayObj ac90degrees) (setq Orientation "Portrait") ) (progn (vla-put-PlotRotation AlayObj ac0degrees) (setq Orientation "Landscape") ) ) (progn (princ "\nLayout=")(princ Layout)(princ "=Rotation=")(princ Rotation)(princ "=Orientation=")(princ Orientation)(princ "=")) (if (and AlayObj (not (vlax-object-released-p AlayObj))) (vlax-release-object AlayObj)) ) ) Here are the results printed to the screen - Layout=AL0.00=Orientation=Landscape=Rotation Before=1=Rotation After=0= Layout=AL0.01=Orientation=Landscape=Rotation Before=1=Rotation After=0= Layout=AL1.00=Orientation=Landscape=Rotation Before=0=Rotation After=0= Layout=AL2.00=Orientation=Portrait=Rotation Before=1=Rotation After=1= Layout=AL3.00=Orientation=Landscape=Rotation Before=0=Rotation After=0= Layout=AL4.00=Orientation=Landscape=Rotation Before=1=Rotation After=0= Layout=AL5.00=Orientation=Portrait=Rotation Before=1=Rotation After=1= Layout=AL6.00=Orientation=Landscape=Rotation Before=0=Rotation After=0= For some reason Layouts AL1.00 & AL6.00 are portrait instead of landscape, even though the values princ seem correct.
2 REPLIES 2
Message 2 of 3
paullimapa
in reply to: Anonymous

Maybe instead of getting the zoom extent coordinates, you should always set it to the Layout window coordinates.  This way you avoid the possibility of zoom extent coordinates giving you a geometry that is an incorrection orientation.


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
Message 3 of 3
Anonymous
in reply to: paullimapa

I found the problem - When I am setting the paper size, I search for "ARCH D" and return the first instance which might be 'ARCH D (36x24)' or 'ARCH D (24x36)'. The plot rotation depends on this value. Wow that was hard!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost