Speedster2 Posted January 2, 2020 Share Posted January 2, 2020 I have modified a lips that join words and forms a text. That was successful. But the original position of the words not deleted. Please help. I have attachment the lisp and sample dwg texts join.lsp Drawing1.dwg Quote Link to comment Share on other sites More sharing options...
SLW210 Posted January 2, 2020 Share Posted January 2, 2020 I have moved your thread to the AutoLISP, Visual LISP & DCL Forum. Please post in the correct forum. Quote Link to comment Share on other sites More sharing options...
marko_ribar Posted January 2, 2020 Share Posted January 2, 2020 Have you tried to replace this : (while (= count slen) (entdel sget) (setq count (1- count)) ) With this : (acet-ss-entdel sset) Regards... 1 Quote Link to comment Share on other sites More sharing options...
Speedster2 Posted January 3, 2020 Author Share Posted January 3, 2020 It worked. Thanks mate. Quote Link to comment Share on other sites More sharing options...
Roy_043 Posted January 3, 2020 Share Posted January 3, 2020 Marko has identified the piece of code that causes the problem. The (= count slen) condition is true only once. 1 Quote Link to comment Share on other sites More sharing options...
BIGAL Posted January 4, 2020 Share Posted January 4, 2020 (edited) My $0.05, note no check if when doing ssget that you pick original text as well. Used strcat rather than change better way to go (defun c:jtxt ( / ss obj toch tnew obj obj2) (command "style" "rs" "romans" "2.2" "0.8" "" "" "" "") (setq obj (vlax-ename->vla-object (car (entsel "\nPick text to change: ")))) (setq toch (vla-get-textstring obj)) (setq ss (ssget (list (cons 0 "text")))) (setq x -1) ; ss starts at 0 (repeat (sslength ss) (setq obj2 (vlax-ename->vla-object (ssname ss (setq x (+ x 1))))) (setq tnew (vla-get-textstring obj2)) (setq toch (strcat toch " " tnew)) (vla-delete obj2) ) (vla-put-textstring obj toch) (vla-put-stylename obj "rs") (princ) ) Edited January 4, 2020 by BIGAL 1 Quote Link to comment Share on other sites More sharing options...
Speedster2 Posted January 4, 2020 Author Share Posted January 4, 2020 Thanks a lot Bigal for your time and for the lisp. Helps me a lot Quote Link to comment Share on other sites More sharing options...
Speedster2 Posted January 4, 2020 Author Share Posted January 4, 2020 On 1/3/2020 at 1:33 PM, Roy_043 said: Marko has identified the piece of code that causes the problem. The (= count slen) condition is true only once. Yeah Roy. Thanks for identifying my mistake. 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.