马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
- ;;;把图纸视埠设为1xp;;;
- ;;; 程序设计:赖云龙 ;;;
- ;;;-----------------;;;
- (defun C:1XP (/ HOLDECHO HOLDBLIP ORIG_OSNAP
- ORIG_UCSFOLLOW A AL A0 W
- WDXF W69 W410
- R15 CH XP
- )
- (command "_.undo" "_group")
- (setq HOLDECHO (getvar "cmdecho"))
- (setq HOLDBLIP (getvar "blipmode"))
- (setq ORIG_OSNAP (getvar "osmode"))
- (setq ORIG_UCSFOLLOW (getvar "ucsfollow"))
- (setvar "cmdecho" 0)
- (setvar "blipmode" 0)
- (setvar "osmode" 0)
- (setvar "ucsfollow" 0)
- (setvar "tilemode" 0)
- (command "_.PSPACE")
- (setq CH (getstring
- "\n所有视埠改为1XP(A)/<选择视埠改为1XP>: "
- )
- )
- (if (= CH "")
- (setq A (ssget '((0 . "VIEWPORT"))))
- (setq A (ssget "x" (list (cons 0 "VIEWPORT"))))
- )
- (setq AL (sslength A))
- (setq A0 0)
- (repeat AL
- (command "_.PSPACE")
- (setq W (ssname A (- AL 1)))
- (setq WDXF (entget W))
- (setq W69 (cdr (assoc 69 WDXF)))
- (if (wcmatch (getvar "acadver") "15*")
- (progn
- (setq W410 (cdr (assoc 410 WDXF)))
- (setq R15 (getvar "ctab"))
- )
- (setq W410 R15)
- )
- (if (and (/= W69 1) (/= W69 0) (= W410 R15))
- (progn
- (command "_.MSPACE")
- (command "_.cvport" W69)
- (COMMAND "_.ZOOM" "1XP")
- )
- )
- (setq AL (- AL 1))
- )
- (command "_.pspace")
- (setvar "blipmode" HOLDBLIP)
- (setvar "osmode" ORIG_OSNAP)
- (setvar "ucsfollow" ORIG_UCSFOLLOW)
- (setvar "cmdecho" HOLDECHO)
- (command "_.undo" "_end")
- (princ)
- )
|