Jump to content

Recommended Posts

Posted

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

Posted

Have you tried to replace this :

  (while (= count slen)
   (entdel sget)
   (setq count (1- count))
  )

 

With this :

(acet-ss-entdel sset)

 

Regards...

  • Thanks 1
Posted

Marko has identified the piece of code that causes the problem. The (= count slen) condition is true only once.

  • Like 1
Posted (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 by BIGAL
  • Thanks 1
Posted

Thanks a lot Bigal for your time and for the lisp. Helps me a lot

Posted
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. 

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...