- [code=lisp](defun c:cvp (/ ss e1 twangle obj doc layouts layout cpt *mypaper*)
- ; (defun MAT:Rot2D (v a / c s x y)
- ; (setq c (cos a) s (sin a))
- ; (setq x (car v) y (cadr v))
- ; (list (- (* x c) (* y s)) (+ (* x s) (* y c)))
- ;)
- (setq doc (vla-get-ActiveDocument (vlax-get-acad-object)))
- (setq twangle (getangle "选择图框倾斜方向:"))
- (setvar "TILEMODE" 0)
- (vl-cmdf "_pspace")
- (vl-cmdf "ERASE" (ssget "x") "")
- (SetQ *mypaper* (VLA-Get-PaperSpace doc))
- ;(Setq cpt (MAT:Rot2D '(300.00 300.00) (- twangle)))
- (setq cpt '(300.00 300.00))
- (vl-cmdf "_zoom" '(0 0 0) '(420 297 0))
- (setq obj (vla-addpviewport *mypaper* (vlax-3d-point '(210 148.5 0)) 420 297))
- ;创建视口 '(210 148.5 0)为视口中心点 420为视口宽度 297为视口高度
-
- (vla-put-TwistAngle obj (- twangle)) ;视口旋转角度
- (vla-Display obj 1) ;视口显示
- (vl-cmdf "_mspace")
- (vl-cmdf "_zoom" "c" cpt "1x" "");以cpt为中心zoom 比例1 显示的模型空间以cpt为中心的区域
- (vl-cmdf "_pspace")
- ;(vla-Display obj 1) ;视口显示
- (vla-put-DisplayLocked obj 1);锁定视口
- )
[/code]
|