Hi, can anybody help me to change this script to work in any coordinate system? In global it work, in local not.
Code:
; Copy fields/texts between cells
(defun c:cfbc () ; VAC
(setq obj (vlax-ename->vla-object (car (entsel "Pick table object"))))
(while t
(setq ans (vla-fieldcode (vlax-ename->vla-object (car (nentsel "\nSelect Cell to Copy Field/Text: ")))))
(setq ins (getpoint "\nSelect Cell to Insert Field/Text: "))
(setq ans1 (LM:Hittest ins (setq Tables (Getacadtableobjects))))
(vla-settext obj (nth 1 ans1) (nth 2 ans1) ans)
)
)
(Defun LM:Hittest ( Pt Lst ) ; Lee Mac
(If (And (Vl-consp Pt) (Vl-every 'Numberp Pt))
(Vl-some
(Function
(Lambda ( O / R C )
(If (Eq :Vlax-true (Vla-hittest O (Vlax-3d-point (Trans Pt 1 0)) (Vlax-3d-point (Trans (Getvar 'Viewdir) 1 0)) 'R 'C)) (List O R C) )
)
)
Lst
)
)
)
(defun LM:getattributevalues ( blk / enx ) ; Lee Mac
(if (and (setq blk (entnext blk)) (= "ATTRIB" (cdr (assoc 0 (setq enx (entget blk))))))
(cons
(cons
(cdr (assoc 2 enx))
(cdr (assoc 1 (reverse enx)))
)
(LM:getattributevalues blk)
)
)
)