明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 625|回复: 2

[讨论] SLdesign 谈文字高度,宽高比,定位方式

[复制链接]
发表于 2024-12-15 17:05:07 | 显示全部楼层 |阅读模式
本帖最后由 尘缘一生 于 2024-12-22 23:09 编辑

一:文字高度
对于文字高度,常用的是3,5系统,也就是,数字、字符高度为3,汉字高度为5,
注意,早期PKPM 是(2.5 5系统),这是真比例绘图,那么你说不对,你的是300,500,这就是3,5系统,为什么呢?
那是因为,你在模型空间不是真比例画的!那么你还是会说不对,你不是1000在模型空间画的是1000吗?是真比例啊?你这是1:1的特例,为了转图纸空间罢了!那么,你1:50,1:100的是吗?所以,这不是真比例。
     那么怎么理解呢?那就是各位啊,你的图纸空间各种比例视口的图,哪就是真比例。只不过,你用了中间技术,画在图纸空间里了,如此而已。
二:文字宽高比
      这个很明确,但这个问题,却涉及多多。定位方式作对了,完全可以抛弃这个参数的。
三:定位方式
     多达15种,为什么这么多?只不过CAD叫大家准确定位文字罢了。

综合以上,这是洋鬼子的CAD造的,假如是中国人开发,绝不会如此2B

既然现实如此,下面分析大家怎么用的。
   当初啊,93年以前,再往前我不得论,建筑界,只有PKPM,中科院用的文字定位为“双穴点”,也就是"F"方式,
如图:
很明显,这文字是左右两个”穴点“,夹起来的,当初我并不明了这个优越性之所在,这种:”吆西!好处大大的!这就是为什么,中科院还是最权威之所在,这种,写文字啊,是可以做到不论字体,宽高比,高度,会狠狠夹死在这两点之间的道理!
   但是:那时候为什么,PKPM在CFG平台里,还提供了一段LISP呢?就是改“左定位”的,如图:

只有左下角这一点,这是不是目前大家都在开发所用的吧?是不是?这也就是PKPM为啥提供那段程序,实际上是“被逼无奈”,为什么?因为到时候,其他二开刚刚坠地,要这么弄,不是后来把PKPM都干倒了吗的那个东西
    危害无穷,众人都错,也就认为应该如此下去罢了!很可惜的是,我得SLdesign,也无奈选择了这种来集成!实在可惜!
图示最大危害性:

这种打开,文字右侧,不齐的,就是左定位的最大危害。
     注:你的二开,采取那种,对应一套文字系统,程序当然也不一样(这就是左定位代码好写,简单罢了)。
各种纠缠,我觉得我难以说清楚,罢了,下面展示SLdesign 处理的办法。以不变应万变吧,作个工具,你自己处理吧,怎么的,你不会?哪管不得开发者了!假如你画图超过30年,你以后品品过往,就知道,你这辈子都在错误的道路上,并未知也!
临江仙·滚滚长江东逝水
【作者】杨慎
滚滚长江东逝水,浪花淘尽英雄。
是非成败转头空。
青山依旧在,几度夕阳红。
白发渔樵江渚上,惯看秋月春风。
一壶浊酒喜相逢。
古今多少事,都付笑谈中。


  1. ;根据 lstSub 子表中的首元素 替换 lstSource 中对应表元-----(一级)--------
  2. ;lstSub需要替换的列表 lstSource源列表 bAdd是否向源列表中追加 原本没有的元素
  3. (defun sl:list-substassoc (lstsub  lstsource  badd / e e1)
  4.   (foreach e lstsub
  5.     (if (setq e1 (assoc (car e) lstsource))
  6.       (setq lstsource (subst e (assoc (car e) lstsource) lstsource))
  7.       (if badd (setq lstsource (append lstsource (list e))))
  8.     )
  9.   )
  10.   lstsource
  11. )
  12. ;;SLdesign V3.0  by  尘缘一生  QQ:15290049
  13. ;原位修改文字对齐方式---(一级)----
  14. (defun text:alignmod (nam mode / p10 p11 ent box b ang)
  15.   (setq ent (entget nam) p10 (dxf1 ent 10) b (cadr (textbox ent)) ang (dxf1 ent 50))
  16.   (setq ent
  17.     (entmod
  18.       (cond
  19.         ((= (strcase mode) "L") ;左对齐
  20.           (sl:list-substassoc (list (cons 10 p10) '(72 . 0) '(73 . 0)) ent t)
  21.         )
  22.         ((= (strcase mode) "C") ;中对齐
  23.           (sl:list-substassoc (list (cons 11 p10) '(72 . 1) '(73 . 0)) ent t)
  24.         )
  25.         ((= (strcase mode) "R") ;右对齐
  26.           (sl:list-substassoc (list (cons 11 p10) '(72 . 2) '(73 . 0)) ent t)
  27.         )
  28.         ((= (strcase mode) "M") ;中心对齐
  29.           (sl:list-substassoc (list (cons 11 p10) '(72 . 4) '(73 . 0)) ent t)
  30.         )
  31.         ((= (strcase mode) "A") ;对齐
  32.           (setq p11 (polar p10 ang (car b)))
  33.           (sl:list-substassoc (list (cons 10 p10) (cons 11 p11) '(72 . 3) '(73 . 0)) ent t)
  34.         )
  35.         ((= (strcase mode) "F") ;调整
  36.           (setq p11 (polar p10 ang (car b)))
  37.           (sl:list-substassoc (list (cons 10 p10) (cons 11 p11) '(72 . 5) '(73 . 0)) ent t)
  38.         )
  39.         ((= (strcase mode) "BL") ;左下
  40.           (sl:list-substassoc (list (cons 11 p10) '(72 . 0) '(73 . 1)) ent t)
  41.         )
  42.         ((= (strcase mode) "BC") ;中下
  43.           (sl:list-substassoc (list (cons 11 p10) '(72 . 1) '(73 . 1)) ent t)
  44.         )
  45.         ((= (strcase mode) "BR") ;右下
  46.           (sl:list-substassoc (list (cons 11 p10) '(72 . 2) '(73 . 1)) ent t)
  47.         )
  48.         ((= (strcase mode) "ML") ;左中
  49.           (sl:list-substassoc (list (cons 11 p10) '(72 . 0) '(73 . 2)) ent t)
  50.         )
  51.         ((= (strcase mode) "MC") ;正中
  52.           (sl:list-substassoc (list (cons 11 p10) '(72 . 1) '(73 . 2)) ent t)
  53.         )
  54.         ((= (strcase mode) "MR") ;右中
  55.           (sl:list-substassoc (list (cons 11 p10) '(72 . 2) '(73 . 2)) ent t)
  56.         )
  57.         ((= (strcase mode) "TL") ;左上
  58.           (sl:list-substassoc (list (cons 11 p10) '(72 . 0) '(73 . 3)) ent t)
  59.         )
  60.         ((= (strcase mode) "IC") ;中上
  61.           (sl:list-substassoc (list (cons 11 p10) '(72 . 1) '(73 . 3)) ent t)
  62.         )
  63.         ((= (strcase mode) "TR") ;右上
  64.           (sl:list-substassoc (list (cons 11 p10) '(72 . 2) '(73 . 3)) ent t)
  65.         )
  66.         (t ent)
  67.       )
  68.     )
  69.   )
  70.   (setq ent (entget (dxf1 ent -1)))
  71.   (setq p11 (mapcar '+ (mapcar '- p10 (dxf1 ent 10)) (dxf1 ent 11)))
  72.   (entmod (sl:list-substassoc (list (cons 10 p10) (cons 11 p11)) ent t))
  73. )
  74. ;;SLdesign V3.0  by  尘缘一生  QQ:15290049
  75. ;;修改文字高|高宽比|对齐方式--------
  76. (defun c:ch-zs (/ ss h0 hi dcl_id re mode nam n)
  77.   (defun dotil (k)
  78.     (set_tile "b0" (rtos (* slbl k) 2 0))
  79.     (setq hi (atof (get_tile "b0")))
  80.     (done_dialog 2)
  81.   )
  82.   ;---------------
  83.   (defun dotilb (k)
  84.     (set_tile "b0" (rtos k 2 2))
  85.     (setq hi (atof (get_tile "b0")))
  86.     (done_dialog 3)
  87.   )
  88.   ;---------------
  89.   (defun dotildc ()
  90.     (done_dialog 5)
  91.   )
  92.   ;---------------
  93.   (setq ss (ssget '((0 . "INSERT,ATTDEF,DIMENSION,TEXT,MTEXT,MULTILEADER,TCH_ARROW,TCH_TEXT,TCH_DRAWINGNAME,TCH_MULTILEADER,TCH_ELEVATION,TCH_MTEXT,ATTRIB"))))
  94.   (setq h0 (e-higt (ssname ss 0)))
  95.   (setq dcl_id (load_dialog (chzhi-dcl)))
  96.   (new_dialog "CHZHI" dcl_id)
  97.   (set_tile "b0" (rtos h0 2 0))
  98.   (action_tile "b0" "(setq hi (atof (get_tile "b0")))")
  99.   (action_tile "b00" "(set_tile "b0" $value)(setq hi (atof (get_tile "b0")))")
  100.   (action_tile "b1" "(dotil 3)")
  101.   (action_tile "b2" "(dotil 4)")
  102.   (action_tile "b3" "(dotil 5)")
  103.   (action_tile "b4" "(dotil 6)")
  104.   (action_tile "b5" "(dotil 7)")
  105.   (action_tile "b6" "(dotil 8)")
  106.   (action_tile "b7" "(dotil 9)")
  107.   (action_tile "b8" "(dotil 10)")
  108.   (action_tile "b9" "(dotil 15)")
  109.   (action_tile "b10" "(dotil 20)")
  110.   (action_tile "b11" "(dotil 25)")
  111.   (action_tile "b12" "(dotil 30)")
  112.   (action_tile "k1" "(dotilb 0.7)")
  113.   (action_tile "k2" "(dotilb 1.0)")
  114.   (action_tile "k3" "(dotilb 1.1)")
  115.   (action_tile "k4" "(dotilb 1.2)")
  116.   (action_tile "k5" "(dotilb 0.6)")
  117.   (action_tile "k6" "(dotilb 0.65)")
  118.   (action_tile "k7" "(dotilb 0.75)")
  119.   (action_tile "k8" "(dotilb 0.8)")
  120.   (action_tile "k9" "(dotilb 0.85)")
  121.   (action_tile "k10" "(dotilb 0.9)")
  122.   (action_tile "k11" "(dotilb 1.3)")
  123.   (action_tile "k12" "(dotilb 1.4)")
  124.   (action_tile "chi" "(setq hi (atof (get_tile "b0")))(done_dialog 2)")
  125.   (action_tile "chbi" "(setq hi (atof (get_tile "b0")))(done_dialog 3)")
  126.   (action_tile "dob" "(done_dialog 4)")
  127.   (action_tile "chzl" "(setq mode "L")(dotildc)")
  128.   (action_tile "chzc" "(setq mode "C")(dotildc)")
  129.   (action_tile "chzr" "(setq mode "R")(dotildc)")
  130.   (action_tile "chzm" "(setq mode "M")(dotildc)")
  131.   (action_tile "chza" "(setq mode "A")(dotildc)")
  132.   (action_tile "chzf" "(setq mode "F")(dotildc)")
  133.   (action_tile "chzbl" "(setq mode "BL")(dotildc)")
  134.   (action_tile "chzbc" "(setq mode "BC")(dotildc)")
  135.   (action_tile "chzbr" "(setq mode "BR")(dotildc)")
  136.   (action_tile "chzml" "(setq mode "ML")(dotildc)")
  137.   (action_tile "chzmc" "(setq mode "MC")(dotildc)")
  138.   (action_tile "chzmr" "(setq mode "MR")(dotildc)")
  139.   (action_tile "chztl" "(setq mode "TL")(dotildc)")
  140.   (action_tile "chztc" "(setq mode "TC")(dotildc)")
  141.   (action_tile "chztr" "(setq mode "TR")(dotildc)")
  142.   (action_tile "cancel" "(done_dialog 0)")
  143.   (setq re (start_dialog))
  144.   (slunloaddcl dcl_id)
  145.   (cond
  146.     ((= re 2)
  147.       (ss-ch-z-hi ss hi (cadr (grread 5)))
  148.     )
  149.     ((= re 3)
  150.       (sl_subupd ss 41 hi)
  151.     )
  152.     ((= re 4);动比
  153.       (macedit-text (sstoslss ss))
  154.     )
  155.     ((= re 5);对齐方式
  156.       (repeat (setq n (sslength ss))
  157.         (setq nam (ssname ss (setq n (1- n))))
  158.         (text:alignmod nam mode)
  159.       )
  160.     )
  161.   )
  162. )
  163. ;;----------
  164. (defun chzhi-dcl (/ lst_str)
  165.   (setq lst_str
  166.     (list
  167.       "CHZHI:dialog {"
  168.       (strcat "label=""
  169.         (slmsg
  170.           "修改文字:            高度|宽高比|对齐方式"
  171.           "эゅ:            蔼|糴蔼ゑ|癸霍よΑ"
  172.           "Modify Text:         Height|Aspect Ratio|Alignment Method"
  173.         ) "";"
  174.       )
  175.       "initial_focus=b0;"
  176.       $boxed_column
  177.       (strcat "label="" (slmsg "字高,宽高比" "蔼,糴蔼ゑ" "Height,Aspect Ratio") "";")
  178.       $row
  179.       ":edit_box{key="b0";allow_accept=true;}"
  180.       (strcat ":slider{key="b00";fixed_widht=true;width=16"
  181.         ";max_value=" (rtos (* slbl 40) 2 0) ";min_value=" (rtos (* slbl 2) 2 0) ";bit_increment=5;small_increment=1;}"
  182.       )
  183.       (strcat ":button{label="" (slmsg "字高" "蔼" "Height") ""; key="chi";}")
  184.       (strcat ":button{label="" (slmsg "宽高比" "糴蔼ゑ" "Aspect ratio") ""; key="chbi";}")
  185.       (strcat ":button{label="" (slmsg "->动比" "->笆ゑ" "->Dynamic ratio") ""; key="dob";}")
  186.       "}"
  187.       $row
  188.       $boxed_column
  189.       (strcat "label="" (slmsg "字高" "蔼" "Height") "";")
  190.       $row
  191.       (strcat ":radio_button {label="" (rtos (* slbl 3) 2 0) "";key="b1";}")
  192.       (strcat ":radio_button {label="" (rtos (* slbl 4) 2 0) "";key="b2";}")
  193.       (strcat ":radio_button {label="" (rtos (* slbl 5) 2 0) "";key="b3";}")
  194.       (strcat ":radio_button {label="" (rtos (* slbl 6) 2 0) "";key="b4";}")
  195.       "}"
  196.       $row
  197.       (strcat ":radio_button {label="" (rtos (* slbl 7) 2 0) "";key="b5";}")
  198.       (strcat ":radio_button {label="" (rtos (* slbl 8) 2 0) "";key="b6";}")
  199.       (strcat ":radio_button {label="" (rtos (* slbl 9) 2 0) "";key="b7";}")
  200.       (strcat ":radio_button {label="" (rtos (* slbl 10) 2 0) "";key="b8";}")
  201.       "}"
  202.       $row
  203.       (strcat ":radio_button {label="" (rtos (* slbl 15) 2 0) "";key="b9";}")
  204.       (strcat ":radio_button {label="" (rtos (* slbl 20) 2 0) "";key="b10";}")
  205.       (strcat ":radio_button {label="" (rtos (* slbl 25) 2 0) "";key="b11";}")
  206.       (strcat ":radio_button {label="" (rtos (* slbl 30) 2 0) "";key="b12";}")
  207.       "}}"
  208.       $boxed_column
  209.       (strcat "label="" (slmsg "宽高比" "糴蔼ゑ" "Aspect ratio") "";")
  210.       $row
  211.       ":radio_button {label="0.6";key="k5";}"
  212.       ":radio_button {label="0.65";key="k6";}"
  213.       ":radio_button {label="0.7";key="k1";}"
  214.       ":radio_button {label="0.75";key="k7";}"
  215.       "}"
  216.       $row
  217.       ":radio_button {label="0.8";key="k8";}"
  218.       ":radio_button {label="0.85";key="k9";}"
  219.       ":radio_button {label="0.9";key="k10";}"
  220.       ":radio_button {label="1.0";key="k2";}"
  221.       "}"
  222.       $row
  223.       ":radio_button {label="1.1";key="k3";}"
  224.       ":radio_button {label="1.2";key="k4";}"
  225.       ":radio_button {label="1.3";key="k11";}"
  226.       ":radio_button {label="1.4";key="k12";}"
  227.       "}}}}"
  228.       $boxed_column
  229.       (strcat "label="" (slmsg "对齐方式" "癸霍よΑ" "Alignment Method") "";")
  230.       $row
  231.       (strcat ":button{label="" (slmsg "*左 " "*オ " "*L") ""; key="chzl";}")
  232.       (strcat ":button{label="" (slmsg " 中 " " い " " C") ""; key="chzc";}")
  233.       (strcat ":button{label="" (slmsg " 右 " "  " " R") ""; key="chzr";}")
  234.       (strcat ":button{label="" (slmsg "中心" "いみ" " M") ""; key="chzm";}")
  235.       (strcat ":button{label="" (slmsg "对齐" "癸霍" " A") ""; key="chza";}")
  236.       (strcat ":button{label="" (slmsg "调整" "秸俱" " F") ""; key="chzf";}")
  237.       "}"
  238.       $row
  239.       (strcat ":button{label="" (slmsg "左下" "オ" "BL") ""; key="chzbl";}")
  240.       (strcat ":button{label="" (slmsg "中下" "い" "BC") ""; key="chzbc";}")
  241.       (strcat ":button{label="" (slmsg "右下" "" "BR") ""; key="chzbr";}")
  242.       (strcat ":button{label="" (slmsg "左中" "オい" "ML") ""; key="chzml";}")
  243.       (strcat ":button{label="" (slmsg "正中" "タい" "MC") ""; key="chzmc";}")
  244.       (strcat ":button{label="" (slmsg "右中" "い" "MR") ""; key="chzmr";}")
  245.       "}"
  246.       $row
  247.       (strcat ":button{label="" (slmsg "左上" "オ" "TL") ""; key="chztl";}")
  248.       (strcat ":button{label="" (slmsg "中上" "い" "TC") ""; key="chztc";}")
  249.       (strcat ":button{label="" (slmsg "右上" "" "TR") ""; key="chztr";}")
  250.       (strcat ":text{label="" (slmsg "    缺省SLdesign:->左" "    SLdesign:->オ" "  SLdesignDefault:->Left") "";}")
  251.       ":tile {}:tile {}:tile {}"
  252.       "}"
  253.       "}"
  254.       $row
  255.       ":tile {}:tile {}:tile {}"
  256.       $canbt
  257.       ":tile {}:tile {}:tile {}"
  258.       "}}"
  259.     )
  260.   )
  261.   (dcl2lisp lst_str)
  262. )


免费的三领链接在此:
SLdesign V3.0 三领设计
链接:https://pan.baidu.com/s/11OnulqGJHNgzukpd_pQgbQ
提取码:zqyu

后续:目前,你要想找一个二开,双穴点定位集成的,是没有的,因为洒家也走在错误的道上,不然,用三领画的图,就另类了!除非你在用PKPM老版本,或某个版本的某个模块。不要给我提什么名字的二开,我头疼,怎么水平的,我还不知道吗?

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

x

评分

参与人数 1明经币 +1 收起 理由
moranyuyan + 1 很给力!

查看全部评分

"觉得好,就打赏"
还没有人打赏,支持一下
回复

使用道具 举报

发表于 2024-12-15 19:10:56 | 显示全部楼层
ss-ch-z-hi 函数少了
回复 支持 反对

使用道具 举报

 楼主| 发表于 2024-12-15 19:15:33 | 显示全部楼层
bai2000 发表于 2024-12-15 19:10
ss-ch-z-hi 函数少了

改字的高度
;;选择集修改文字高度----(一级)----
;;ss 选择集  hi 新字高  pt nil 当前鼠标点位
(defun ss-ch-z-hi (ss hi pt / e el n tp tp1 nam)
        (repeat (setq n (sslength ss))
                (setq nam (ssname ss (setq n (1- n))) e (entget nam) tp (dxf1 e 0))
                (cond
                        ((member tp '("TEXT" "MTEXT" "TCH_TEXT" "ATTDEF" "TCH_MTEXT"))
                                (vla-scaleentity (en2obj nam) (vlax-3D-point (cadr (e9pt nam nil))) (/ hi (dxf1 e 40)))
                        )
                        ((and (= tp "INSERT") (= (dxf1 e 66) 1)) ;;单独属性块文字
                                (entmod (emod (entget (entnext nam)) 40 hi))
                                (entupd nam)
                        )
                        ((and (= tp "INSERT")
                                 (if (not pt) (setq pt (cadr (grread 5)))) ;;用于块操作
                                 (setq e (nentselp pt))
                                 (= (length e) 4) ;;块的实体表数为4
                                 (setq el (entget (car e)) tp1 (dxf1 el 0))
                                 (member tp1 '("TEXT" "MTEXT" "TCH_TEXT" "TCH_MTEXT"))
                         )
                                (entmod (emod el 40 hi))
                                (entupd (car (last e)))
                                (entupd nam)
                        )
                        ((member tp '("DIMENSION" "MULTILEADER" "TCH_ELEVATION" "TCH_ARROW"))
                                (setq e (entlast))
                                (expl-dim (ssadd nam))
                                (ss-ch-z-hi (last_ent e) hi nil)
                        )
                )
        )
函数嵌套,一一下去,很麻烦,你用自己内库,替代即可。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2025-2-23 10:25 , Processed in 0.196141 second(s), 27 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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