mhupp Posted August 13, 2021 Share Posted August 13, 2021 To cut down on spam I'm would like to reworking one of my lisp. Currently for each selected cell its sending the the command + the cell.value to AutoCAD. So if i have 5 cells selected it runs the command 5 times. What i would like to do now is send one command for all selected cells. (FT '("cell1.value" "cell2.value" "cell3.value" "cell4.value" "cell5.value")) I have already rewritten the lisp part to handle this. ;;----------------------------------------------------------------------------;; ;; Find Text & Draw Line (defun FT (lst / x txt SS PT) (vl-load-com) (setvar 'cmdecho 0) (setvar 'clayer "0") (foreach x lst (setq SS (ssget "_X" (list (cons 0 "*TEXT") (cons 1 (strcat "*" x "*")) (cons 410 (getvar 'ctab))))) (if (= SS nil) (princ (strcat "\n\"" x "\" Not Found")) (foreach txt (mapcar 'cadr (ssnamex SS)) (Setq PT (cdr (assoc 11 (entget txt)))) (vl-cmdf "_.Line" "_non" "0,0,0" "_non" PT "") ) ) ) (setvar 'cmdecho 1) (princ) ) Quote Link to comment Share on other sites More sharing options...
BIGAL Posted August 13, 2021 Share Posted August 13, 2021 I am a bit confused cell do you mean a table cell ? lee-mac has a hittest for picking a cell so could run it twice start - end of range then loop through the table pulling the text values out and making a list. Quote Link to comment Share on other sites More sharing options...
mhupp Posted August 13, 2021 Author Share Posted August 13, 2021 Sorry didn't explain that. highlight cells in excel have a VBA over there that then sends the command to autocad one at a time now but want to build them into a list and send it once. Quote Link to comment Share on other sites More sharing options...
mhupp Posted August 13, 2021 Author Share Posted August 13, 2021 Everything im finding is not set for AutoCAD list. It would be more (red, Blue, Green) rather then '("red" "Blue" "Green") I thinking it might be easier to pass the cell.value one at a time over to CAD and build the list their then run the command. Quote Link to comment Share on other sites More sharing options...
mhupp Posted August 13, 2021 Author Share Posted August 13, 2021 Decided to just put in a alert instead of pompt when something isn't found. Quote Link to comment Share on other sites More sharing options...
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.