一套程序适合多版本CAD问题
本帖最后由 尘缘一生 于 2024-7-12 00:35 编辑有好多的问题,是没有资料可查的,在于自己摸索.......
比如:MNU菜单的具体格式解释的问题等,那么,对于本问题也是,摸索来,摸索去呢,由于,我没有功夫,也没有时间,去安装个繁体版,英文版的CAD,去测试些玩意,我自以为,这样是可以的了,是对的,那么到底对还是不对呢?
首先:判定使用CAD者的所在地区的代码页:
[*](setq k1 (getvar "SYSCODEPAGE")) ;取得所在地区的代码页
[*](cond
[*]((= k1 (strcase "ansi_936")) ;;CAD是简体版
[*] (setq $Lgver 1 $hz "hz" $xz "xz" k0 "bz" str "简体中文"
[*] $okbt ":button {label=\"确定\";key=\"accept\";is_default=true;}"
[*] $canbt ":button {label=\"取消\"; key=\"cancel\";is_cancel=true;}"
[*] )
[*])
[*]((= k1 (strcase "ansi_950")) ;繁体版
[*] (setq $Lgver 2 $hz "fan" $xz "fank" k0 "ft" str "羉砰いゅ"
[*] $okbt ":button {label=\"絋﹚\";key=\"accept\";is_default=true;}"
[*] $canbt ":button {label=\"\"; key=\"cancel\";is_cancel=true;}"
[*] )
[*])
[*]((and (/= k1 (strcase "ansi_936")) (/= k1 (strcase "ansi_950"))) ;;英文或其他版
[*] (setq $Lgver 3 $hz "hz" $xz "xz" k0 "en" str "Englishversion"
[*] $okbt ":button {label=\"Accept\";key=\"accept\";is_default=true;}"
[*] $canbt ":button {label=\"Cancel\"; key=\"cancel\";is_cancel=true;}"
[*] )
[*])
[*])
以上我做了个全局变量 $Lgver,其余是三领系统的设置问题,忽略不管即可。
再构造了一个函数
[*];;简体、繁体、英文提示---(一级)-----
[*];;msg1 简体字 nilmsg2 繁体字 nil msg3 英文 nil--
[*](defun slmsg (msg1 msg2 msg3 / msg)
[*](cond
[*] ((= $Lgver 1)
[*] (setq msg msg1)
[*] )
[*] ((= $Lgver 2) ;繁体版
[*] (setq msg msg2)
[*] )
[*] ((= $Lgver 3)
[*] (setq msg msg3)
[*] )
[*])
[*]msg ;;输出信息
[*])
使用:
比如:(princ "\n 选择要修改颜色的实体:")
要是,简体CAD,繁体CAD,英文CAD都可以正常显示呢,我是这么作的:
(princ (slmsg "\n 选择要修改颜色的实体:" "\n 匡拒璶э肅︹龟砰:" "\n Select the entity to modify the color:"))
本帖最后由 尘缘一生 于 2024-7-11 22:57 编辑
下面是,判定版本的一段dcl代码片段
[*]
[*](defun dcl-xz-dcl (/ lst_str)
[*](setq lst_str
[*] (append
[*] (list "dhxz:dialog {"
[*] (slmsg "label=\"三领设计 V3.0 字符系统 \";" "label=\"烩砞璸 V3.0 才╰参\";" "label=\"Sldesign V3.0 Character system\";")
[*] "initial_focus=tile0;"
[*] $row
[*] $boxed_row
[*] (slmsg "label=\"文字内容为=:\";" "label=\"ゅず甧=:\";" "label=\"The text is=:\";")
[*] (strcat ":button{label=\"" (slmsg "<-点取" "<-翴" "<-Pick") "\"; key=\"dq\";}")
[*] ":edit_box {key=\"tile0\";value=\"\";width=25;allow_accept=true;}"
[*] (strcat ":button{label=\"" (slmsg "清空->" "睲->" "Clear->") "\"; key=\"qk\";}")
[*] "}"
[*] $boxed_row
[*] )
[*] (cond
[*] ((= $Lgver 1)
[*] (list
[*] "label=\"当前比例\";"
[*] ":text{label=\"比例\";}"
[*] ":text{key=\"blstr\";is_bold=true;value=\"0.0000\";width=6;} "
[*] ":button{label=\"换比\"; key=\"chbl\";}"
[*] "}}"
[*] $boxed_radio_row
[*] "label=\"数字:\";"
[*] )
[*] )
[*] ((= $Lgver 2)
[*] (list
[*] "label=\"讽玡ゑㄒ\";"
[*] ":text{label=\"ゑㄒ\";}"
[*] ":text{key=\"blstr\";is_bold=true;value=\"0.0000\";width=6;} "
[*] ":button{label=\"传ゑ\"; key=\"chbl\";}"
[*] "}}"
[*] $boxed_radio_row
[*] "label=\"计:\";"
[*] )
[*] )
[*] ((= $Lgver 3)
[*] (list
[*] "label=\"Current scale\";"
[*] ":text{label=\"Scale\";}"
[*] ":text{key=\"blstr\";is_bold=true;value=\"0.0000\";width=6;} "
[*] ":button{label=\"Chscale\"; key=\"chbl\";}"
[*] "}}"
[*] $boxed_radio_row
[*] "label=\"number:\";"
[*] )
[*] )
[*] )
[*] (list
[*] ":radio_button {label=\"0\";key=\"tile10\";}"
[*] ":radio_button {label=\".\";key=\"tile24\";}"
[*] ":radio_button {label=\"1\";key=\"tile1\";}"
[*] ":radio_button {label=\"2\";key=\"tile2\";}"
[*] ":radio_button {label=\"3\";key=\"tile3\";}"
[*] ":radio_button {label=\"4\";key=\"tile4\";}"
[*] ":radio_button {label=\"5\";key=\"tile5\";}"
[*] ":radio_button {label=\"6\";key=\"tile6\";}"
[*] ":radio_button {label=\"7\";key=\"tile7\";}"
[*] ":radio_button {label=\"8\";key=\"tile8\";}"
[*] ":radio_button {label=\"9\";key=\"tile9\";}"
[*] "}"
[*] $boxed_radio_row
[*] (slmsg "label=\"钢筋:\";" "label=\"葵惮:\";" "label=\"steelbar:\";")
[*] ":radio_button {label=\"@\";key=\"tile16\";}"
[*] ":radio_button {label=\"100\";key=\"tile27\";}"
[*] ":radio_button {label=\"120\";key=\"tile28\";}"
[*] ":radio_button {label=\"150\";key=\"tile29\";}"
[*] ":radio_button {label=\"200\";key=\"tile30\";}"
[*] ":radio_button {label=\"250\";key=\"tile31\";}"
[*] (slmsg ":radio_button {label=\"φ\";key=\"tile14\";}" ":radio_button {label=\"\";key=\"tile14\";}" ":tile {}")
[*] (slmsg ":radio_button {label=\"Ф\";key=\"tile15\";}" ":radio_button {label=\"?\";key=\"tile15\";}" ":tile {}")
[*] )
[*] (cond
[*] ((= $Lgver 1)
[*] (list
[*] ":radio_button {label=\"三级\";key=\"tile48\";}"
[*] ":radio_button {label=\"四级\";key=\"tile49\";}"
[*] "}"
[*] $boxed_radio_row
[*] "label=\"标高:\";"
[*] ":button {label=\"±0.000\";key=\"tile26\";}"
[*] ":button {label=\"现场\";key=\"tile53\";}"
[*] ":radio_button {label=\"中心\";key=\"tile54\";}"
[*] ":radio_button {label=\"(结构)\";key=\"tile55\";}"
[*] ":radio_button {label=\"(建筑)\";key=\"tile56\";}"
[*] ":radio_button {label=\"绝对\";key=\"tile57\";}"
[*] ":radio_button {label=\"相对\";key=\"tile58\";}"
[*] )
[*] )
[*] ((= $Lgver 2)
[*] (list
[*] ":radio_button {label=\"\";key=\"tile48\";}"
[*] ":radio_button {label=\"\";key=\"tile49\";}"
[*] "}"
[*] $boxed_radio_row
[*] "label=\"夹蔼:\";"
[*] ":button {label=\"∮0.000\";key=\"tile26\";}"
[*] ":button {label=\"瞷初\";key=\"tile53\";}"
[*] ":radio_button {label=\"いみ\";key=\"tile54\";}"
[*] ":radio_button {label=\"(挡篶)\";key=\"tile55\";}"
[*] ":radio_button {label=\"(縱)\";key=\"tile56\";}"
[*] ":radio_button {label=\"荡癸\";key=\"tile57\";}"
[*] ":radio_button {label=\"癸\";key=\"tile58\";}"
[*] )
[*] )
[*] ((= $Lgver 3)
[*] (list
[*] ":tile {}"
[*] ":tile {}"
[*] "}"
[*] $boxed_radio_row
[*] "label=\"elevation:\";"
[*] ":tile {}"
[*] ":button {label=\"Scene\";key=\"tile53\";}"
[*] ":radio_button {label=\"Core\";key=\"tile54\";}"
[*] ":radio_button {label=\"(structure)\";key=\"tile55\";}"
[*] ":radio_button {label=\"(Architecture)\";key=\"tile56\";}"
[*] ":radio_button {label=\"Absolutely\";key=\"tile57\";}"
[*] ":radio_button {label=\"Relative\";key=\"tile58\";}"
[*] )
[*] )
[*] )
[*] (if (/= $Lgver 3)
[*] (list
[*] "}"
[*] ":tile {}:tile {}"
[*] $boxed_radio_row
[*] (slmsg "label=\"符号:\";" "label=\"才腹:\";" "label=\"Symbol:\";")
[*] $column
[*] ":radio_button {label=\"Ⅰ\";key=\"tile59\";}"
[*] ":radio_button {label=\"Ⅱ\";key=\"tile60\";}"
[*] ":radio_button {label=\"Ⅲ\";key=\"tile61\";}"
[*] ":radio_button {label=\"Ⅳ\";key=\"tile62\";}"
[*] ":radio_button {label=\"Ⅴ\";key=\"tile63\";}"
[*] "}"
注:港台地区用的是BIG5码,写LISP程序,仅把汉字变为繁体是不行的,需要变为BIG5的繁体表示,下面是我使用的一个工具,可以作这个事
本帖最后由 尘缘一生 于 2024-7-11 23:58 编辑
e2002 发表于 2024-7-11 23:27
按这种写法太罗嗦了,DCL上控件上显示的文字,既然只是语言不同,那就做好全部的 list ,格式例如: ( (sTi ...
[*](setq
[*] $row ":cluster {horizontal_margin=none; vertical_margin=none; children_alignment=centered;"
[*] $column ":cluster {layout=vertical;horizontal_margin=none;vertical_margin=none;"
[*] $boxed_row ":cluster {boxed=true;children_alignment=centered;"
[*] $boxed_column ":cluster {layout=vertical;boxed=true;"
[*] $radio_row ":radio_cluster {horizontal_margin=none;vertical_margin=none;children_alignment=centered;"
[*] $radio_column ":radio_cluster {layout=vertical;horizontal_margin=none;vertical_margin=none;"
[*] $boxed_radio_row ":radio_cluster {boxed=true;children_alignment=centered;"
[*] $boxed_radio_column ":radio_cluster {layout=vertical;boxed=true;"
[*])
这也是一部分设置常量,做表再精简的写法,或更高效的,我还没想起来。以不变应万变。
感谢大佬的分享! 本帖最后由 尘缘一生 于 2024-7-11 23:12 编辑
对于商业化,团队开发者,他们有的是人员,时间,精力,他们可以招收一个学生去专门负责这个事去,
发布简体版啊,繁体版啊,英文版啊
对于我来说,我可没功夫这么去做,因此,弄了一套程序去维护。
那么好了,有没有一种代码,不用这么麻烦,适合多种版本呢?编码方式又是什么?(我问的技术就是这个!如果有这个技术,那么用的那个编辑器?编码是哪套?)
注意:这个问题和浩辰啊,中望啊,天正啊,等等。。。没任何关系。
对于我来说呢,凡是图纸不符合CAD标准的,都是垃圾;垃圾的图纸,垃圾软件作的。
不要说你多么厉害,多么爱国,哪没用。你开发的软件,工具箱,画的图纸,你必须复合CAD标准,别作一些你自己特有的,连“湾湾"都瞧不起你的,印度更不会,就不用提西方世界了!,那更不用提明经论坛了!
举例说明:比如,天正。它的图纸,你不转T3,T6,CAD能看不?
支持支持。 大佬厉害:handshake 友喝高了? 按这种写法太罗嗦了,DCL上控件上显示的文字,既然只是语言不同,那就做好全部的 list ,格式例如: ( (sTileName0 (sCodePage0 . "OK") (sCodePage1 . "确定") ( ...).......) 或者 ((sCodepage0 (sTile0 . "OK") (sTile1 . "Cancel") ....) (sCodePage1 (sTile0 . "确定") (sTile1 . "取消") .....))
程序中按当前SysCodePage ,生成对应的 DCL文件即可。 天正不就是附在CAD上的一个工具而已吗
页:
[1]
2