0 Members and 1 Guest are viewing this topic.
(cdr (assoc 331 (entget (cdr (assoc 360 (entget (cdr (assoc 360 (entget (cdr (assoc 360 (entget (cdr (assoc 360 (entget (car (nentsel "\nSelect a field: "))) ) ) ) ) ) ) ) ) ) ) ) ) ))
;;; FLD-OBJ -Gilles Chanteau- 16/12/06;;; Highlights the linked object to the selected field;;; An option allows to create a line from the fied to the object;;; Works with fields in tables and blocks(defun c:fld-obj (/ ent txt elst dic chp obj) (while (not (and (setq ent (nentsel "\nSelect a field: ")) (setq txt (car ent)) (setq elst (entget txt)) (member (cdr (assoc 0 elst)) '("*TEXT" "ATTRIB")) ) ) (princ "\nNone field selected.") ) (if (and (setq dic (cdr (assoc 360 elst))) (setq dic (cdr (assoc 360 (entget dic)))) (setq chp (cdr (assoc 360 (entget dic)))) (= (cdr (assoc 0 (entget chp))) "FIELD") (setq chp (cdr (assoc 360 (entget chp)))) ) (if (setq obj (cdr (assoc 331 (entget chp)))) (progn (redraw obj 3) (initget "Yes No") (if (= "Yes" (getkword "\nLink the object to the text ? [Yes/No] <No>: ") ) (entmake (list '(0 . "LINE") (cons 10 (if (< 2 (length ent)) (setq pt (mapcar '+ (cdr (assoc 10 (entget (car (last ent))))) (cdr (assoc 10 elst)) ) ) (setq pt (cdr (assoc 10 elst))) ) ) (cons 11 (cdr (assoc 10 (entget obj)))) ) ) ) ) (princ "\nThe field isn't linked to an object.") ) (princ "\nthe textdo not contains a field.") ) (princ))
Sofito,To easily recreate the scenario, on a 64-bit machine, create an MText field referencing say, the area, of an LWPolyline. Then attempt to retrieve the LWPolyline object/entity from only the MText field.Lee