(defun c:ZAF ( / note nxt ) ; note to fixtures (defun LinkedTextstr (ent / obj objID str) (vl-load-com) (command "UCS" "WORLD") (if ent (setq kind (cdr (assoc 0 (entget ent))))) ;%<\AcObjProp Object(%<\_ObjId 2116322144>%).TextString \f "%tc1">% (setq obj (vlax-ename->vla-object ent) objID (vla-get-objectid obj) str (strcat "%<\\AcObjProp Object(%<\\_ObjId "(rtos objID 2 0)">%).TextString \\f \"%tc1\">%") ) ) ; defun linked textstr (local) (while (not note) (setq note (car (entsel "Select note: "))) ) ; while (setq preins (cdr (assoc 10 (entget note)))) (setq nxt (entnext note)) (while (not (= "SEQEND" (cdr (assoc 0 (entget nxt))))) (cond ((= "CONTROL_ZONE" (cdr (assoc 2 (entget nxt)))) (setq cze nxt cz (cdr (assoc 1 (entget nxt))))) ((= "LOCATION" (cdr (assoc 2 (entget nxt)))) (setq loe nxt lo (cdr (assoc 1 (entget nxt))))) ((= "USER" (cdr (assoc 2 (entget nxt)))) (setq ute nxt ut (cdr (assoc 1 (entget nxt))))) ) ; cond (setq nxt (entnext nxt)) ) ; while (while (setq fx (car (entsel "Now a fixture: "))) (setq curins (cdr (assoc 10 (entget fx)))) (setq nxt (entnext fx)) (while (not (= "SEQEND" (cdr (assoc 0 (entget nxt))))) (cond ((= "CONTROL_ZONE" (cdr (assoc 2 (entget nxt)))) (entmod (subst (cons 1 (linkedtextstr cze)) (assoc 1 (entget nxt)) (entget nxt)))) ((= "LOCATION" (cdr (assoc 2 (entget nxt)))) (entmod (subst (cons 1 (linkedtextstr loe)) (assoc 1 (entget nxt)) (entget nxt)))) ((= "USER" (cdr (assoc 2 (entget nxt)))) (entmod (subst (cons 1 (linkedtextstr ute)) (assoc 1 (entget nxt)) (entget nxt)))) ) ; cond (setq nxt (entnext nxt)) ) ; while (command "LAYER" "M" "LITE-CTRL" "C" "150" "LITE-CTRL" "" "") (COMMAND "LAYER" "OFF" "LITE-ATTR-FILENAME" "OFF" "LITE-ATTR-LOCATION" "OFF" "LITE-ATTR-NMBR" "OFF" "LITE-ATTR-POSITION" "OFF" "LITE-ATTR-USER" "") (command "arc" preins "e" curins "a" -60) (setq preins curins) ) ; while (princ) (command "fieldeval" "31") (command "UCS" "VIEW") (setq cmdvar (getvar "cmdecho")) (setvar "cmdecho" 0) ;turns off command line echo (setq opt "_b") ;sets opt to "_b" (back) ) ; c:ZAF