Jump to content

Lisp:real in expression


LASSAADTH

Recommended Posts

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 by LASSAADTH
Link to comment
Share on other sites

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