TheSwamp

CAD Forums => CAD General => Topic started by: Fabricio28 on January 12, 2015, 12:45:40 PM

Title: Copy text inside the table
Post by: Fabricio28 on January 12, 2015, 12:45:40 PM
Hi guys,

I'm making a table with 200 animal's names. But sometimes I have to repeat some names.

Is it possible to copy the text from a cell into other cell?

Thank in advance
Title: Re: Copy text inside the table
Post by: mjfarrell on January 12, 2015, 12:52:08 PM
ctrl+C


ctrl+V
Title: Re: Copy text inside the table
Post by: Fabricio28 on January 12, 2015, 01:00:08 PM
ctrl+C


ctrl+V

Thank you for replay mjfarrel.

Maybe a lisp will be better. I think that autocad would give a easier command to do that.
Title: Re: Copy text inside the table
Post by: Rob... on January 12, 2015, 01:04:35 PM
How about:
Right click copy, then right click paste?

No code needed. This is basic windows stuff.
Title: Re: Copy text inside the table
Post by: Fabricio28 on January 12, 2015, 01:07:00 PM
I'm doing that mate,

It is so easy...
I thought that I had to select the text and copy and paste. But it just copy the table.


Thank you very much
Title: Re: Copy text inside the table
Post by: ronjonp on January 12, 2015, 01:15:38 PM
Another way to skin the cat  :)

Code - Auto/Visual Lisp: [Select]
  1. ;; Based off of code here: http://www.theswamp.org/index.php?topic=47176.msg522080#msg522080
  2. (defun c:foo (/ _foo col p r row ss txt)
  3.   (defun _foo (tables p / col o row ss)
  4.     (if (vl-some '(lambda (x)
  5.                     (and (eq :vlax-true
  6.                              (vla-hittest
  7.                                x
  8.                                (vlax-3d-point (trans p 1 0))
  9.                                (vlax-3d-point (trans (getvar 'viewdir) 1 0))
  10.                                'row
  11.                                'col
  12.                              )
  13.                          )
  14.                          (setq o x)
  15.                     )
  16.                   )
  17.                  tables
  18.         )
  19.       (list o row col)
  20.     )
  21.   )
  22.   (if (and (setq ss (ssget "_X" (list (cons 0 "acad_table") (cons 410 (getvar 'ctab)))))
  23.            (setq ss (mapcar 'vlax-ename->vla-object (mapcar 'cadr (ssnamex ss))))
  24.       )
  25.     (if (and (setq p (getpoint "\nPick a cell to set text: "))
  26.              (setq r (_foo ss p))
  27.              (/= "" (setq txt (vlax-invoke (car r) 'getcellvalue (cadr r) (caddr r))))
  28.         )
  29.       (while (setq p (getpoint "\nPick cells to place text: "))
  30.         (if (setq r (_foo ss p))
  31.           (vla-settext (car r) (cadr r) (caddr r) txt)
  32.         )
  33.       )
  34.     )
  35.     (princ "\nNo Tables found!")
  36.   )
  37.   (princ)
  38. )
Title: Re: Copy text inside the table
Post by: Rob... on January 12, 2015, 01:21:29 PM
What does "foo" stand for?
Title: Re: Copy text inside the table
Post by: ronjonp on January 12, 2015, 01:24:43 PM
What does "foo" stand for?
http://www.urbandictionary.com/define.php?term=foo
AKA .. here's the code you name it :)
Title: Re: Copy text inside the table
Post by: Rob... on January 12, 2015, 01:26:56 PM
Ahhh, it's a coder thing. TY.
Title: Re: Copy text inside the table
Post by: Fabricio28 on January 12, 2015, 01:38:11 PM
What does "foo" stand for?
http://www.urbandictionary.com/define.php?term=foo
AKA .. here's the code you name it :)

Thank you very much ronjonp.
Worked like a charm  :-D
Title: Re: Copy text inside the table
Post by: mjfarrell on January 12, 2015, 02:09:42 PM
What does "foo" stand for?

Code-Foo


like Kung Fu  only nerdier