LASSAADTH Posted May 29, 2015 Share Posted May 29, 2015 (edited) Hello, It's my first with you, I am a beginner I programmed this lisp to create text (X, Y) where Y is a value that must consider a real value (PC) and I transform it to a string with the rtos function (setq B(rtos (PC))). The problem is: when I want to create the text according to the expression (setq ptcoord (strcat x "/" B))) it does not accept the string B someone can help me solve this problem? **************** (defun c:CFE (/ P1 x y ptcoord PC AXE ss PO pt) ; Definition Intersection (setq PC (getreal "\nPC\n")) (if (and (setq ss (ssget '(( 0 . "LINE,LWPOLYLINE")))) (= 2 (sslength ss)) (setq int (vLa-intersectwith (vLax-ename->vLa-Object (ssname ss 0)) (vLax-ename->vLa-Object (ssname ss 1)) acextendnone)) (setq PO (vLax-safearray->List (vLax-variant-vaLue int)))) (repeat (/ (length PO) 3) (setq pt (list (car PO) (cadr PO) (caddr PO))) (command "_.POINT" pt) "") ) (while (setq P1 (getpoint "\Point Fe: ")) (setq x (rtos (- (car P1) (car PO)) 2 4)) (setq y (rtos (- (cadr P1) (cadr PO)) 2 4)) (setq B (rtos (PC) 2 4)) (setq ptcoord (strcat x "/" B)) (setq ptxt (list (car P1) (cadr PO))) (command "_MTEXT" ptxt "R" 100 "S" "Legend" "H" 5 "L" 20 ptcoord "") ) ) *************** Thank you. Edited May 29, 2015 by LASSAADTH Quote Link to comment Share on other sites More sharing options...
tombu Posted May 29, 2015 Share Posted May 29, 2015 Welcome to the forums! Change (setq B (rtos (PC) 2 4)) to (setq B (rtos PC 2 4)) since PC is a local variable not a function. Quote Link to comment Share on other sites More sharing options...
LASSAADTH Posted May 29, 2015 Author Share Posted May 29, 2015 YES:D It's Good! Thank you very much for your help. 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.