明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 925|回复: 7

[提问] 请教lisp标注出来的文字变问号如何解决?

[复制链接]
发表于 2021-11-10 11:32:07 | 显示全部楼层 |阅读模式
请教各位吴彦祖,下面的索引编号文字为什么显示问号?如何解决?
;       =============================================
(defun C:sy( / lay scab scale pt1 pt2 pt3 pt4 pt5 pt6 high dx dy dx1 dy1
                txt1 txt2 txt3 be)
  (setvar "CMDECHO" 0)
  (setq lay (getvar "clayer"))
  (command "color" "bylayer")
  (command "layer" "m" "sy" "c" "g" "sy" "")
  (if (or (= nil (tblsearch "style" "gbcbig"))
          (/= (cdr (assoc 40 (tblsearch "style" "gbcbig"))) 0)
      )
    (command "STYLE" "gbcbig" "txt" "0" ".8" "0" "n" "n" "n")
  )
  (if (= scab nil) (setq scab 100))
  (setq scale (getreal (strcat "\nScale <" (rtos scab 2 0) ">:")))
    (if (= scale nil) (setq scale scab))
    (setq scab scale)
  (setq pt1 (getpoint "\n第一点: "))
  (setq pt2 (getpoint pt1 "\n第二点: "))
  (setq dy (car pt1))
  (setq dy1 (car pt2))
  (setq be T)
  (if (> dy1 dy) (setq be nil))

  (setq txt1 (strcase (getstring "\n图集名称:") nil))
  (setq txt2 (getstring "\n详图编号:"))
  (setq txt3 (getstring "\n图集页次:"))

  (setq high (* scale 4))
    (setq dy (cadr pt2))
    (setq dx (car pt2))
    (if (= be nil)
       (setq dx1 (+ dx (* scale 5)))
       (setq dx1 (- dx (* scale 5)))
    )
    (setq dy1 (+ dy (* scale 1.15)))
    (setq pt3 (list dx1 dy1))
  (if (= be nil)
     (command "text" pt3 high "0" txt1)
     (command "text" "j" "r" pt3 high "0" txt1)
  )
  (if (= be nil)
    (progn
      (setq pt4 (polar pt2 0 (* scale (+ 5 (* 4 0.8 (strlen txt1)) 1.5 5))))
      (command "pline" pt1 "w" "0" "0" pt2 (polar pt4 0 (* 5 scale)) "")
      (command "circle" pt4 (* 5 scale))
    )
    (progn
      (setq pt4 (polar pt2 pi (* scale (+ 5 (* 4 0.8 (strlen txt1)) 1.5 5))))
      (command "pline" pt1 "w" "0" "0" pt2 (polar pt4 pi (* 5 scale)) "")
      (command "circle" pt4 (* 5 scale))
    )
  )

    (setq dy (cadr pt4))
    (setq dx (car pt4))
    (setq dx1 (- dx (* scale 1.2)))
    (setq dy1 (+ dy (* scale 0.9)))
    (setq pt5 (list dx1 dy1))
    (setq pt6 (polar pt5 0 (* scale 2.4)))
  (command "text" "j" "f" pt5 pt6 (* scale 3.3) txt2)

    (setq dx1 (- dx (* scale 1.2)))
    (setq dy1 (- dy (* scale 4.2)))
    (setq pt5 (list dx1 dy1))
    (setq pt6 (polar pt5 0 (* scale 2.4)))
  (command "text" "j" "f" pt5 pt6 (* scale 3.3) txt3)

  (command "layer" "s" lay "")
  (princ)
)      


发表于 2021-11-10 12:45:02 | 显示全部楼层
换个字体再试试
 楼主| 发表于 2021-11-10 13:07:57 | 显示全部楼层
已经换过一次,之前是xw,换成gbcbig,还是不行,我也很纳闷
发表于 2021-11-10 17:50:25 | 显示全部楼层
肯定是字体的问题,写出来的? 号,多替换几次,找一个能显示的字体,然后运行代码的时候先切换到正确的字体后再写文字试试
发表于 2021-11-10 22:18:40 | 显示全部楼层
我试了一下,没有问号,正常显示.
发表于 2021-11-11 15:45:45 | 显示全部楼层
如果在运行LSP之前
先运行TEXTSTYLE更换一下标注字体
不知道这样子是否有用!
发表于 2021-11-11 20:35:20 | 显示全部楼层
fedd 发表于 2021-11-10 13:07
已经换过一次,之前是xw,换成gbcbig,还是不行,我也很纳闷

改成standard试试
发表于 2021-11-12 15:30:36 | 显示全部楼层
建议画图的时候不要弄太多字体,就一个宋体就可以了
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2025-5-17 07:14 , Processed in 0.156404 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表