- ;论坛搜一圈没找到把选择标注的样式,切换为另一种样式的例子,请教一下大家,谢谢!
- (defun c:DUP (/ p)
- (setvar "cmdecho" 0)
- (princ "\n选择需修改的标注 :")
- (setq p (ssget))
- (command "dim" "up" p "" "1:50") ; 这里需要把选择标注的样式,切换为1:50
- (setvar "cmdecho" 1)
- )
- ;以下是我找到的一些例子,就是没有上面这个。
- (defun c:DUP (/ p); 把选择标注对应的样式激活为当前标注样式
- (setvar "cmdecho" 0)
- (princ "\n选择需修改的标注 :")
- (setq p (ssget))
- (command "dim" "up" p "" "e")
- (setvar "cmdecho" 1)
- ;(command "-DIMSTYLE" "R" (cdr (assoc 3 (entget (car (entsel)))))) ;选择的标注激活为当前标注
- )
- (defun c:DUP (/ p)
- (if (not (tblsearch "dimstyle" "1:50"))
- (command "-dimstyle" "s" "1:50") ;新建样式
- (command "-dimstyle" "s" "1:50" "y")
- )
- )
- (defun c:DUP () ;当前样式切换为:1:50
- (command "-DIMSTYLE" "R" "1:50")
- (princ "\n当前标注样式:1:50")
- (princ)
- )
|