1.1英寸刻度
2.1/2“刻度
3、满标度
你的意思是在选项选择中,显示样式名称是什么?
对的 可能
(defun c:ReON (/ tmp)
(or *nth (setq *nth 0))
(setq *dim_table* '(
;;<<--Adjustments-->>
;;Layers . Styles
("DIM_LAYER1" . "DIM_STYL1")
("DIM_LAYER2" . "DIM_STYL2")
("DIM_LAYER3" . "DIM_STYL3")
;;<<------------------->>
))(vl-load-com)
(setq *doc
(vla-get-ActiveDocument
(vlax-get-acad-object)))
(if (not *Dim:React*)
(progn
(setq *Dim:React*
(vlr-command-reactor nil
(list
(cons :vlr-CommandWillStart'StrComm)
(cons :vlr-CommandEnded 'EndComm)
(cons :vlr-CommandCancelled'CanComm))))
(foreach x *dim_table*
(if (not (tblsearch "LAYER" (car x)))
(vla-add
(vla-get-layers *doc) (car x)))
(if (not (tblsearch "DIMSTYLE" (cdr x)))
(vla-add
(vla-get-Dimstyles *doc) (cdr x))))
(princ "\n<<- Reactor Initiated ->>")))
(initget (+ 2 4))
(or (not
(setq tmp
(getint
(strcat "\nSpecify Config [1-"
(itoa (length *dim_table*)) "] <"
(itoa (1+ *nth)) "> : "))))
(setq *nth (1- tmp)))
(princ))
(defun StrComm (React Args / pos)
(setq old#lay (getvar "CLAYER") old#sty (getvar "DIMSTYLE"))
(if (or (wcmatch (strcase (car Args)) "*DIM*")
(eq "QLEADER" (strcase (car Args))))
(progn
(setq pos (nth *nth *dim_table*))
(vl-catch-all-apply
(function
(lambda ( )
(vla-put-ActiveDimstyle *doc
(vla-item
(vla-get-Dimstyles *doc) (cdr pos))))))
(setvar "CLAYER" (car pos))))
(princ))
(defun EndComm (React Args)
(if (and old#lay old#sty
(wcmatch (strcase (car Args)) "DIM*"))
(progn
(vl-catch-all-apply
(function
(lambda ( )
(vla-put-ActiveDimstyle *doc
(vla-item
(vla-get-Dimstyles *doc) old#sty)))))
(setvar "CLAYER" old#lay)))
(princ))
(defun CanComm (React Args)
(if (and old#lay old#sty
(wcmatch (strcase (car Args)) "DIM*"))
(progn
(vl-catch-all-apply
(function
(lambda ( )
(vla-put-ActiveDimstyle *doc
(vla-item
(vla-get-Dimstyles *doc) old#sty)))))
(setvar "CLAYER" old#lay)))
(princ))
(defun c:ReOFF (/ old#lay old#sty *doc *nth *dim_table*)
(if *Dim:React*
(progn
(vlr-remove *Dim:React*)
(setq *Dim:React* nil)
(princ "\n<<- Reactor Deactivated ->>")))
(princ))
就是这样。非常感谢你。
我很高兴你喜欢它 Perhaps?
(defun c:ReON (/ tmp str i) (or *nth (setq *nth 0)) (setq *dim_table* '( ;; ;;Layers . Styles ("DIM_LAYER1" . "DIM_STYL1") ("DIM_LAYER2" . "DIM_STYL2") ("DIM_LAYER3" . "DIM_STYL3") ;; ))(vl-load-com) (setq *doc (vla-get-ActiveDocument (vlax-get-acad-object))) (if (not *Dim:React*) (progn (setq *Dim:React* (vlr-command-reactor nil (list (cons :vlr-CommandWillStart'StrComm) (cons :vlr-CommandEnded 'EndComm) (cons :vlr-CommandCancelled'CanComm)))) (foreach x *dim_table* (if (not (tblsearch "LAYER" (car x))) (vla-add (vla-get-layers *doc) (car x))) (if (not (tblsearch "DIMSTYLE" (cdr x))) (vla-add (vla-get-Dimstyles *doc) (cdr x)))) (princ "\n"))) (setq i 1 str (strcat (itoa i) (chr 46) (cdar *dim_table*))) (foreach x (cdr *dim_table*) (setq i (1+ i) str (strcat str (chr 32) (itoa i) (chr 46) (cdr x)))) (initget (+ 2 4)) (or (not (setq tmp (getint (strcat "\nSpecify Config: " str " : ")))) (setq *nth (1- tmp))) (princ))(defun StrComm (React Args / pos) (setq old#lay (getvar "CLAYER") old#sty (getvar "DIMSTYLE")) (if (or (wcmatch (strcase (car Args)) "*DIM*") (eq "QLEADER" (strcase (car Args)))) (progn (setq pos (nth *nth *dim_table*)) (vl-catch-all-apply (function (lambda ( ) (vla-put-ActiveDimstyle *doc (vla-item (vla-get-Dimstyles *doc) (cdr pos)))))) (setvar "CLAYER" (car pos)))) (princ))(defun EndComm (React Args) (if (and old#lay old#sty (wcmatch (strcase (car Args)) "DIM*")) (progn (vl-catch-all-apply (function (lambda ( ) (vla-put-ActiveDimstyle *doc (vla-item (vla-get-Dimstyles *doc) old#sty))))) (setvar "CLAYER" old#lay))) (princ))(defun CanComm (React Args) (if (and old#lay old#sty (wcmatch (strcase (car Args)) "DIM*")) (progn (vl-catch-all-apply (function (lambda ( ) (vla-put-ActiveDimstyle *doc (vla-item (vla-get-Dimstyles *doc) old#sty))))) (setvar "CLAYER" old#lay))) (princ))(defun c:ReOFF (/ old#lay old#sty *doc *nth *dim_table*) (if *Dim:React* (progn (vlr-remove *Dim:React*) (setq *Dim:React* nil) (princ "\n"))) (princ)) that did it.Thank you very much.
I'm happy that you like it
页:
1
[2]