Author Topic: Copy text inside the table  (Read 2561 times)

0 Members and 1 Guest are viewing this topic.

Fabricio28

  • Swamp Rat
  • Posts: 670
Copy text inside the table
« 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

mjfarrell

  • Seagull
  • Posts: 14444
  • Every Student their own Lesson
Re: Copy text inside the table
« Reply #1 on: January 12, 2015, 12:52:08 PM »
ctrl+C


ctrl+V
Be your Best


Michael Farrell
http://primeservicesglobal.com/

Fabricio28

  • Swamp Rat
  • Posts: 670
Re: Copy text inside the table
« Reply #2 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.

Rob...

  • King Gator
  • Posts: 3824
  • Take a little time to stop and smell the roses.
Re: Copy text inside the table
« Reply #3 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.
CAD Tech

Fabricio28

  • Swamp Rat
  • Posts: 670
Re: Copy text inside the table
« Reply #4 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

ronjonp

  • Needs a day job
  • Posts: 7529
Re: Copy text inside the table
« Reply #5 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. )
« Last Edit: January 12, 2015, 01:20:50 PM by ronjonp »

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

Rob...

  • King Gator
  • Posts: 3824
  • Take a little time to stop and smell the roses.
Re: Copy text inside the table
« Reply #6 on: January 12, 2015, 01:21:29 PM »
What does "foo" stand for?
CAD Tech

ronjonp

  • Needs a day job
  • Posts: 7529
Re: Copy text inside the table
« Reply #7 on: January 12, 2015, 01:24:43 PM »

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

Rob...

  • King Gator
  • Posts: 3824
  • Take a little time to stop and smell the roses.
Re: Copy text inside the table
« Reply #8 on: January 12, 2015, 01:26:56 PM »
Ahhh, it's a coder thing. TY.
CAD Tech

Fabricio28

  • Swamp Rat
  • Posts: 670
Re: Copy text inside the table
« Reply #9 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

mjfarrell

  • Seagull
  • Posts: 14444
  • Every Student their own Lesson
Re: Copy text inside the table
« Reply #10 on: January 12, 2015, 02:09:42 PM »
What does "foo" stand for?

Code-Foo


like Kung Fu  only nerdier 
Be your Best


Michael Farrell
http://primeservicesglobal.com/