?? hometuf.mnl
字號:
)
(defun c:ai_fms ( / fmsa fmsb)
(setq m:err *error* *error* *merr*)
(ai_undo_push)
(if (getvar "TILEMODE") (setvar "TILEMODE" 0))
(setq fmsa (vports) fmsb (nth 0 fmsa))
(if (member 1 fmsb)
(if (> (length fmsa) 1)
(command "_.mspace")
(progn
(ai_sysvar '("cmdecho" . 1))
(command "_.mview")
(while (eq 1 (logand 1 (getvar "CMDACTIVE")))
(command pause)
)
(ai_sysvar NIL)
(command "_.mspace")
)
)
)
(ai_undo_pop)
(setq *error* m:err m:err nil)
(princ)
)
(defun ai_onoff (var)
(setvar var (abs (1- (getvar var))))
(princ)
)
;;; go to paper space
(defun c:ai_pspace ()
(ai_undo_push)
(if (/= 0 (getvar "tilemode"))
(command "_.tilemode" 0)
)
(if (/= 1 (getvar "cvport"))
(command "_.pspace")
)
(ai_undo_pop)
(princ)
)
;;; go to tilemode 1
(defun c:ai_tilemode1 ()
(ai_undo_push)
(if (/= 1 (getvar "tilemode"))
(command "_.tilemode" 1)
)
(ai_undo_pop)
(princ)
)
;;; Pop menu Draw/ Dim/ Align Text/ Centered
;;; Toolbar Dimensions/ Align Text/ Centered
(defun ai_dim_cen (/ ai_sysvar ai_dim_ss)
(setq ai_sysvar (getvar "cmdecho"))
(setvar "cmdecho" 0)
(cond
((setq ai_dim_ss (ssget "_P" '((0 . "DIMENSION"))))
(command "_.dimoverride" "_dimjust" 0 "" ai_dim_ss ""
"_.dimtedit" ai_dim_ss "_h")
)
(T nil)
)
(setvar "cmdecho" ai_sysvar)
(princ)
)
;;; Shortcut menu for Dimension Text Above
(defun c:ai_dim_textabove (/ ss)
(ai_sysvar '("cmdecho" . 0))
(if (setq ss (ssget "_I"))
(command "_.dimoverride" "_dimtad" 3 "" ss "")
(if (setq ss (ssget))
(command "_.dimoverride" "_dimtad" 3 "" ss "")
)
)
(ai_sysvar NIL)
(princ)
)
;;; Shortcut menu for Dimension Text Center
(defun c:ai_dim_textcenter (/ ss)
(ai_sysvar '("cmdecho" . 0))
(if (setq ss (ssget "_I"))
(command "_.dimoverride" "_dimtad" 0 "" ss "")
(if (setq ss (ssget))
(command "_.dimoverride" "_dimtad" 0 "" ss "")
)
)
(ai_sysvar NIL)
(princ)
)
;;; Shortcut menu for Dimension Text Home
(defun c:ai_dim_texthome (/ ss)
(ai_sysvar '("cmdecho" . 0))
(if (setq ss (ssget "_I"))
(command "_.dimedit" "_h")
(if (setq ss (ssget))
(command "_.dimedit" "_h" ss)
)
)
(ai_sysvar NIL)
(princ)
)
;;; Screen menu item for CIRCLE TaTaTan option.
;;; first, get points on entities
(defun ai_circtanstart()
(setq m:err *error* *error* *merr*)
(ai_sysvar
(list '("cmdecho" . 0)
;; make sure _tan pick for CIRCLE gets same entity
(cons "aperture" (getvar "pickbox"))
)
)
;; prompts are the same as CIRCLE/TTR command option
(setq pt1 (ai_entsnap "\n輸入切點定義: " nil))
(setq pt2 (ai_entsnap "\n輸入第二個切點的定義: " nil))
(setq pt3 (ai_entsnap "\n輸入第三個切點的定義: " nil))
)
;;; Command-line version
(defun c:ai_circtan (/ pt1 pt2 pt3)
(ai_circtanstart)
(ai_sysvar '("osmode" . 256))
(command "_.circle" "_3p" "_tan" pt1 "_tan" pt2 "_tan" pt3)
(ai_sysvar nil)
(setq *error* m:err m:err nil)
(princ)
)
;;; Use this if CMDNAMES == CIRCLE
(defun ai_circtan (/ pt1 pt2 pt3)
(ai_circtanstart)
(ai_sysvar '("osmode" . 256))
(command "_3p" pt1 pt2 pt3)
(ai_sysvar nil)
(setq *error* m:err m:err nil)
(princ)
)
;;;=== Make Object's Layer Current =============================
;; Makes the layer of the selected object current. If there is one
;; object in the pickfirst set, it's layer is made current without
;; prompting for an object. Else a prompt is issued.
(defun c:ai_molc(/ old_error end_undo old_cmdecho set1 ent undo_control)
;; Simple error handling.
(defun molc_error (s)
;; Reset error handling.
(if old_error (setq *error* old_error))
;; End undo if we started one.
(if (eq end_undo 1) (command "_.undo" "_end"))
;; Reset command echo
(if old_cmdecho (setvar "cmdecho" old_cmdecho))
;; Silent exit.
(princ)
)
;; Save current error function.
(setq old_error *error*)
;; Set error handling to molc's error function.
(setq *error* molc_error)
;; Save cmdecho setting.
(setq old_cmdecho (getvar "cmdecho"))
;; Turn off cmdecho
(setvar "cmdecho" 0)
;; If Pickfirst is on and the selction set contains
;; one object, then use it, else prompt for one.
(if (and (eq 1 (logand 1 (getvar "pickfirst")))
(setq set1 (ssget "_i"))
(eq 1 (sslength set1))
)
(progn
(setq ent (entget (ssname set1 0)))
(sssetfirst nil nil)
)
(progn
(sssetfirst nil nil)
(setq ent (entget (car (entsel "\n選擇將使其圖層成為當前圖層的對象: "))))
)
)
;; Get undo setting.
(setq undo_control (getvar "undoctl"))
;; Initialize flag to to end undo.
(setq end_undo 0)
;; Begin Undo group if need be.
(if (and (= 1 (logand 1 undo_control)) ; undo on
(/= 2 (logand 2 undo_control)) ; not single undo
(/= 8 (logand 8 undo_control)) ; no active group
)
(progn
;; Begin a new one
(command "_.undo" "_begin")
;; Set flag so that we know to end undo.
(setq end_undo 1)
)
)
;; Make object's layer current.
(setvar "clayer" (cdr (assoc '8 ent)))
;; Print message
(princ (strcat "\n" (getvar "clayer") " 現在是當前圖層。"))
;; Undo end
(if (eq 1 end_undo)
(command "_.undo" "_end")
)
;; Turn on cmdecho
(setvar "cmdecho" old_cmdecho)
;; Reset error function.
(setq *error* old_error)
;; Silent exit.
(princ)
)
;;; Shortcut menu Deselect All item.
(defun ai_deselect ()
(if (= (getvar "cmdecho") 0) ;start if
(command "_.select" "_r" "_all" "")
(progn ;start progn for cmdecho 1
(setvar "cmdecho" 0)
(command "_.select" "_r" "_all" "")
(setvar "cmdecho" 1)
) ;end progn for cmdecho 1
) ;end if
(terpri)
(prompt "所有對象都已取消選擇")
(princ)
)
;;;
;;; Enable Draworder to be called from a menu
;;; Checks for Pickfirst selected objects
;;;
(defun ai_draworder (option / ss )
(setq m:err *error* *error* *merr*)
(ai_sysvar '("cmdecho" . 0))
(if (setq ss (ssget "_I"))
(command "_.draworder" option)
(if (setq ss (ssget))
(command "_.draworder" ss "" option)
)
)
(ai_sysvar NIL)
(setq *error* m:err m:err nil)
(princ)
)
(defun c:vlisp ()
(if (/= nil c:vlide) (c:vlide))
)
(princ "已加載。")
(princ)
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -