Lee Mac 发表于 2022-7-6 13:33:34

不是一个问题伙伴,
 
您需要记住,函数不会在字符串文字中求值,因此需要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))

cl082000 发表于 2022-7-6 13:38:33

伙计,你就是那个男人!!!!!!!!谢谢你我得到了我想要的我相信我很快会再次拜访你

Lee Mac 发表于 2022-7-6 13:42:14

很乐意帮助mate

cl082000 发表于 2022-7-6 13:45:06

李,我的朋友,日常工作做得很好。我还加了一些东西。我冒险偏离了航线,又迷路了。先生,您介意看一下吗。
 
6
 
它不会吐出多行文字。如果setq d=6“S/80管道,则应为:
 
6“S/80管道足够
 
请告诉我哪里出了问题?

Lee Mac 发表于 2022-7-6 13:49:29

变量“D”不是数字,而是字符串,因此不需要RTO:
 
7

cl082000 发表于 2022-7-6 13:50:46

谢谢你

Lee Mac 发表于 2022-7-6 13:56:00

没问题
页: 1 [2]
查看完整版本: AutoLISP中的多行文字