briankstan 发表于 2022-7-6 13:39:31

这正是我想要的。有没有办法填写他们的风格?
 
1.1英寸刻度
2.1/2“刻度
3、满标度

Lee Mac 发表于 2022-7-6 13:42:15

 
你的意思是在选项选择中,显示样式名称是什么?

briankstan 发表于 2022-7-6 13:45:38

 
对的

Lee Mac 发表于 2022-7-6 13:47:44

可能
 

(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))

briankstan 发表于 2022-7-6 13:51:40

就是这样。非常感谢你。

Lee Mac 发表于 2022-7-6 13:54:12

 
我很高兴你喜欢它

briankstan 发表于 2022-7-6 13:55:57

Lee Mac 发表于 2022-7-6 13:58:56

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))

briankstan 发表于 2022-7-6 14:02:27

that did it.Thank you very much.

Lee Mac 发表于 2022-7-6 14:07:50

 
I'm happy that you like it
页: 1 [2]
查看完整版本: 诡异的朦胧。。。