(defun c:test () (vl-load-com) (vl-cmdf "_.ucs" "_world") (setq clayout (vla-item (vla-get-layouts (vla-get-activedocument (vlax-get-acad-object)) ) "Model" ) )
(vla-put-configname clayout "传真") ;此处应根据实际情况修改来设置打印设备
(vla-put-centerplot clayout :vlax-true) (vla-put-CanonicalMediaName clayout "A4") (vla-put-plotwithplotstyles clayout :vlax-true) (vla-put-standardscale clayout acscaletofit) (setq cplot (vla-get-plot (vla-get-activedocument (vlax-get-acad-object)))) ; (setq i 1 points '() pointsT '()) (while (< i 8) (setq pt1 (getpoint "\n 1st point :")) (setq pt2 (getcorner pt1 "\n 2st point :")) (setq pointsT (list pt1 pt2)) (setq points (cons pointsT points)) (setq i (+ i 1)) ) ; (setq i 0) (while (< i 7) (setq pt1 (car (nth i points)) pt2 (cadr (nth i points)) ) (setq p1 (vlax-make-safearray vlax-vbdouble '(1 . 2))) (setq pv1 (vlax-make-variant (vlax-safearray-fill p1 (list (car pt1) (cadr pt1)) ))) (setq p2 (vlax-make-safearray vlax-vbdouble '(1 . 2))) (setq pv2 (vlax-make-variant (vlax-safearray-fill p2 (list (car pt2) (cadr pt2)) ))) ; (vla-setwindowtoplot clayout pv1 pv2) (vla-put-plottype clayout acwindow ) ; (if (> (abs (- (car pt1) (car pt2))) (abs (- (cadr pt1) (cadr pt2))) ) (vla-put-plotrotation clayout ac90degrees) (vla-put-plotrotation clayout ac180degrees) ) ; (princ "\n preview.....") ;(setq cplot (vla-get-plot (vla-get-activedocument (vlax-get-acad-object)))) (vla-displayplotpreview cplot acfullpreview) ; (setq i (+ i 1)) ) ; (vl-cmdf "_.ucs" "_P") (prin1) ); |