Hi
I have recently upgraded to 2015 and this lisp now doesn't work for attributes.
It wont let me select an attribute, it works fine for text. Any idea of a fix please?
; Vovka http://www.theswamp.org/index.php?topic=21303.0
;;; move single attribute AS
(defun c:AS nil (C:MOVEATTXT))
(defun C:MOVEATTXT (/ CE OS Ent EntProps LastPoint LastEnt *error*)
(defun *error* (msg)
(if OS
(setvar 'OSMODE OS)
)
(if CE
(setvar 'CMDECHO CE)
)
(if LastEnt
(entdel LastEnt)
)
(vl-cmdf "._UNDO" "_END")
(if (or (= msg "Function cancelled") (= msg "quit / exit abort"))
(princ)
(princ (strcat "\nError: " msg))
)
)
(setq OS (getvar 'OSMODE)
CE (getvar 'CMDECHO)
)
(vl-cmdf "._UNDO" "_BEGIN")
(setvar 'CMDECHO 0)
(setvar 'OSMODE 0)
(if
(and
(progn (while (not (and (setq Ent (nentsel "\nSelect an attribute/text: "))
(= (length Ent) 2)
(wcmatch (cdr (assoc 0 (setq EntProps (entget (car Ent)))))
"ATTRIB,TEXT"
)
)
)
)
Ent
)
(= (cdr (assoc 0 EntProps)) "ATTRIB")
(setq LastPoint (cadr Ent)
LastEnt (entmakex
(cons
(cons 0 "TEXT")
(subst
(cons 73 (cdr (assoc 74 EntProps)))
(assoc 74 EntProps)
(subst
(cons
10
(cdr
(assoc
(if
(= 0 (cdr (assoc 72 EntProps)) (cdr (assoc 74 EntProps)))
10
11
)
EntProps
)
)
)
(assoc 10 EntProps)
(vl-remove-if
(function (lambda (g)
(vl-position (car g) '(-1 0 2 5 70 73 100 280 330))
)
)
EntProps
)
)
)
)
)
)
)
(progn
(setvar "LASTPOINT" LastPoint)
(command "._MOVE" LastEnt "" (cadr Ent) PAUSE)
(if (not (equal LastPoint (getvar "LASTPOINT")))
(progn (entmod
(subst (assoc 11 (entget LastEnt))
(assoc 11 EntProps)
(subst (assoc 10 (entget LastEnt)) (assoc 10 EntProps) EntProps)
)
)
(entupd (car Ent))
)
)
(entdel LastEnt)
)
(command "._MOVE" (car Ent) "" (cadr Ent) PAUSE)
)
(setvar 'OSMODE OS)
(setvar 'CMDECHO CE)
(vl-cmdf "._UNDO" "_END")
(princ)
)