dszlapka Posted January 9 Posted January 9 Hi I have short lisp, writed by someone. It read clicked polyline lenght and put result to clicked attribute in block. I would like to add on end string a sign "m". I tried "strcat", but it not worked. Someone help me ? (defun c:KT_dlugosc ( / poly att) (while (and (setq poly (ssget "_+.:S:E" '((0 . "*LINE")))) (setq att (car (nentsel "\nSelect Attribute"))) (eq "AcDbAttribute" (vla-get-objectname (setq att (vlax-ename->vla-object att))) ) ) (vlax-put att 'TextString (rtos (vlax-curve-getDistAtParam (setq poly (ssname poly 0)) (vlax-curve-getEndParam poly) ) 2 0 ) ) )(princ) ) Quote
fuccaro Posted January 9 Posted January 9 Hello Dszlapka, welcome in the forum! I am in vacation right now, I can't test it, but the "strcat" method should work. (defun c:KT_dlugosc ( / poly att) (while (and (setq poly (ssget "_+.:S:E" '((0 . "*LINE")))) (setq att (car (nentsel "\nSelect Attribute"))) (eq "AcDbAttribute" (vla-get-objectname (setq att (vlax-ename->vla-object att))) ) ) (vlax-put att 'TextString (strcat (rtos (vlax-curve-getDistAtParam (setq poly (ssname poly 0)) (vlax-curve-getEndParam poly) ) 2 0 ) "m") ) )(princ) ) Please try this code and post a feed-back. Post the error message you get, for sure someone will be able to fix it! 1 1 Quote
dszlapka Posted January 10 Author Posted January 10 Thanks a lot. It works as I wanted. I see it was very simple, but not for me I used "strcat" incorrectly. Have a nice holiday. 1 Quote
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.