VAC Posted September 4, 2023 Posted September 4, 2023 (edited) Hi, I have field in the table cell (gets value from one block's attribute) and I want to move or copy this to another cell or table, but CTRL+C and CTRL+V do not function. Inserted content (field) is than corrupted - object not found ####.... How to do this? Edited September 4, 2023 by VAC Quote
CyberAngel Posted September 5, 2023 Posted September 5, 2023 I can't find a simple way to do what you're asking. However, I did find a way to copy fields. When you edit a field in the Field window, you'll see an expression in the bottom pane that defines the field. It begins and ends with percent (%) characters. Select that expression and copy it to the clipboard. You can then paste that expression into a text object. I tried it, and it works! Quote
VAC Posted September 5, 2023 Author Posted September 5, 2023 (edited) Thank you, I know this way but it is tedious and slow and I need to do many shifts. I don't understand why it doesn't work in the normal expected way (copy&paste)..... Edited September 5, 2023 by VAC Quote
VAC Posted September 6, 2023 Author Posted September 6, 2023 I got this answer https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-copy-field-between-cells-in-the-table-or-between-tables/td-p/12219194 Quote
VAC Posted September 11, 2023 Author Posted September 11, 2023 (edited) I did this script (CopyFieldBetweenCells) - works fine (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 "Select 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) ) ) ) Edited September 11, 2023 by VAC Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.