Both styles are in use, so can't be purged..
I want to rename "A" to "B".. but as "B" already exists, I can't. So the question.. How do I "move" the dim's on style "A".. to style "B"..
via lisp (no user input)..
You can use my SSMOD function (see below) to modify the DXF value for the dimstyle of selected dimensions.
To select dimensions of style "A" use
(setq sset (SSGET "X" '((0 . "DIMENSION") (3 . "A"))))
To modify the selection use
(SSMOD sset 3 "A")
You can use SSMOD to modify any other dxf value of the selected entities, i.e. (ssmod (ssget) 8 "NEWLAYER") moves all selected entities to layer "NEWLAYER".
Tom Berger
;;;; LISP STARTS HERE ->
;;; SSMOD changes DXF values of AutoCAD drawing entities ;;; usage: (ssmod <selection set> dxf-code new-value ;;; ;;; (ssmod (ssget) 8 "NEWLAYER") moves the selected entities to ;;; layeer NEWLAYER ;;; (ssmod (ssget '((0 . "INSERTION"))) 2 "NEWBLOCKREF") changes ;;; the references for selected block insertions to "NEWBLOCKREF" ;;; (ssmod (ssget '((0 . "INSERTION"))) 10 '(0 0 0)) changes ;;; the insertion point for selected block insertions to 0,0,0 ;;; ;;; (c) Tom Berger 1994 ;;; free to be used by everybody ;;;
(defun ssmod (ss dxf val)
(mapent '(lambda (ename)
(ssmodent ename dxf val)
)
ss
)
)
(defun mapent (fun ss / i)
(repeat (setq i (sslength ss))
((lambda (proc args / ss fun i)
(apply
proc
args
)
)
fun
(list (ssname ss (setq i (1- i))))
)
)
)
(defun ssmodent (ename dxf val / old)
(if (setq old (assoc dxf (entget ename)))
(entmod (subst
(cons dxf val)
old
(entget ename)
)
)
(entmod (cons (cons dxf val) (entget ename)))
)
)
;;;; <- LISP ENDS HERE