give this a try.
;*********************************************************************************************************************************************************
; komondormrex, may 2023
;*********************************************************************************************************************************************************
(defun put_cell_value (string / cell_picked table_selected_object row_number column_number checking_vector table_sset)
(setq checking_vector (vlax-3d-point (getvar 'viewdir)))
(while (null cell_picked)
(setq picked_point (vl-catch-all-apply 'getpoint (list (strcat "\nPick a cell of a table to put \"" string "\" into: "))))
(cond
(
(vl-catch-all-error-p picked_point)
(setq cell_picked t)
)
(
(null picked_point)
)
(
t
(setq table_sset (ssget "_f" (list
picked_point
(list (car picked_point) (+ (cadr (getvar 'viewctr)) (/ (getvar 'viewsize) 2.0)))
)
'((0 . "ACAD_TABLE"))
)
)
(cond
(
(null table_sset)
)
(
(and
(= :vlax-true (vla-hittest (setq table_selected_object (vlax-ename->vla-object (ssname table_sset 0)))
(vlax-3d-point picked_point) checking_vector 'row_number 'column_number
)
)
(or
(= :vlax-true (vla-get-titlesuppressed table_selected_object))
(and
(= :vlax-false (vla-get-titlesuppressed table_selected_object))
(not (zerop row_number))
)
)
)
(setq cell_picked t)
(vla-setcellvalue table_selected_object row_number column_number string)
)
(
t
)
)
)
)
)
)
;*********************************************************************************************************************************************************
(defun c:put_text_to_table_cell nil
(put_cell_value (cdr (assoc 1 (entget (car (entsel "\nPick text entity to copy text string: "))))))
(princ)
)
;*********************************************************************************************************************************************************
Thank you for your cooperation. I did.
Is it possible for this program to function on the Autocad LT version?
If possible, I would like to run this program on the Autocad LT version.
unfortunately it would not work in autocad lt, even in autocad 2024 lt, since it has no support for visual lisp vl* functionality.
Thank you to everyone who replied. I am currently using the LT version.
Do you have LT 2024, cut and paste sections of code to test and what does not work which bit of the code ? It may be possible to do a work around.
I am guessing Hit-test.
If it is this then remove it. Hopefully no errors will occur.
vl-catch-all-apply
What I said was a possible work around may be needed, need to know which bit of code is failing VL* is just to broad a statement. There is support for a lot of VL in LT 2024, check out comments about what does not work.
Because LT 24 does not have VLIDE you need to copy and paste to command line the code in small sections and test.
test 1 if this line works then catch-all is probably ok.
(setq picked_point (vl-catch-all-apply 'getpoint (list (strcat "\nPick a cell of a table to put \"" string "\" into: "))))
Thinking about hit-test check.
I tried to run your program on trial full version(Not Lt version), then it did work well.
Your program is no problrem.
att.gif
well, i was wrong stating that autocad 2024 lt does not support visual lisp vl* functionality. it does with some limitations(. but every vanilla version of autocad lt prior to 2024 lt as far as i know does not support autolisp in any form. yours 2013 lt too.
As stated lisp has only been added to LT 2024 any earlier version and it will not work.
I would suggest try select text then Ctrl+C, select cell then Ctrl+V.
I always pasted the code to the command line on LT VERSION.
For example, the command to copy the following text is pasted.
If VL is included, an error has occurred.