不是一个问题伙伴,
您需要记住,函数不会在字符串文字中求值,因此需要strcat来连接字符串:
- (defun c:davitcal (/ z w l s)
- (setq Z (getreal "Enter pipe section modulus:"))
- (setq W (getreal "Enter est. dead weight (FLG. + parts):"))
- (setq L (getreal "Enter length of moment arm:"))
- (setq S (getreal "Enter stress value for davit arm:"))
- (entmake
- (list
- (cons 0 "MTEXT") ;; Entity Name
- (cons 100 "AcDbEntity") ;; Subclass Marker
- (cons 410 "Model") ;; Space
- (cons 8 "0") ;; Layer
- (cons 100 "AcDbMText") ;; Subclass Marker
- (cons 10 '(5.0 3.0 0)) ;; Insertion Point
- (cons 40 0.1) ;; Text Height
- (cons 71 5) ;; Attachment Point (Mid-Cent)
- (cons 1 (strcat "Z="(rtos Z)"IN\\PW="(rtos W)"#\\PL="(rtos L)"IN\\PS="(rtos S)"PSI")) ;; Text Content
- (cons 7 "STANDARD"))) ;; Text Style
- (princ))
|