找回密码
 [加入论坛]
查看: 1492|回复: 1

[转帖]组成编号

[复制链接]
2443725 发表于 2004-9-24 19:32 | 显示全部楼层 |阅读模式
<>编设计组成需要顺序编号、编材料表需要顺序编号、…… </P>
<P>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;ZCBH.lsp 组成编号
;;;* C:ZCBH
;;;-- XYP@bsedi.com
;;;2004.09.21
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(prompt "\n\r 加载组成编号程序。")
;-------------------------------------------
;;;主程序 </P>



<P>;;;组成编号
(defun c:ZCBH (/ pt1 pt2 shzh n bhfs txt sz-zh)
(cmdla0)
(initget "A B C")
(setq bhfs (getkword "\n请选择编号方式:A-普通/B-前缀/C-后缀.&lt;A-普通&gt;:"))
(setq bhfs (if bhfs bhfs "A"))
(if (= bhfs "B")(setq txt (getstring"\n\t前缀 : ")))
(if (= bhfs "C")(setq txt (getstring"\n\t后缀 : ")))
(COMMAND "style" "宋体" "宋体" (* SC 300) "1" "0" "" "")
(while (not (setq pt1 (getpoint"\n\t起点 : "))))
(while (not (setq no3 (ureal 1 "" "起始数" 1))))
(while (not (setq no2 (ureal 1 "" "行数" no2))))
(setq no4 (ureal 1 "" "行距" 1100))
(menucmd "s=tkfengmian")
(setq shzh (fix no3) n 0)
(mkla"图框-组成-编号"3)
(while (&lt; n no2)
(if (= bhfs "A")
(progn
(command "text" "j" "ML" pt1 "0" shzh)
(setq n (+ n 1) shzh (+ shzh 1)
pt1 (list(car pt1)(-(cadr pt1) no4))
)
)
)
(if (= bhfs "B")
(progn
(setq sz-zh (strcat txt (RTOS shzh 2 0)));sz-zh数字组合
(command "text" "j" "ML" pt1 "0" sz-zh)
(setq n (+ n 1) shzh (+ shzh 1)
pt1 (list(car pt1)(-(cadr pt1) no4))
)
)
)
(if (= bhfs "C")
(progn
(setq sz-zh (strcat (RTOS shzh 2 0) txt));sz-zh数字组合
(command "text" "j" "ML" pt1 "0" sz-zh)
(setq n (+ n 1) shzh (+ shzh 1)
pt1 (list(car pt1)(-(cadr pt1) no4))
)
)
)
)
(cmdla1)
(pxyp"ZCBH (组成编号)")
);defun</P>
<P>;;;-------------------------------------------
;;;子程序
;;;
(defun CMDLA0 ()
(setq cmdech (GETVAR "CMDECHO"))
(setq oom (getvar "orthomode"))
(setq osm (getvar "osmode"))
(SETQ LA (getvar "clayer"))
(setvar "regenmode" 1)
(SETVAR "CMDECHO" 0)
)</P>
<P>;;;
(defun CMDLA1 ()
(SETVAR "CMDECHO" cmdech)
(setvar "orthomode" oom)
(setvar "osmode" osm)
(setvar "clayer" LA)
(setvar "regenmode" 1)
)</P>
<P>;;;
(defun ureal (bit kwd msg def / inp)
(if def
(setq msg (strcat "\n" msg "&lt;" (rtos def 2) "&gt;: ")
bit (* 2 (fix (/ bit 2)))
)
(setq msg (strcat "\n" msg ": "))
)
(initget bit kwd)
(setq inp (getreal msg))
(if inp inp def)
)</P>
<P>;;;
(Defun MKLA (a b)
(If (= (Tblsearch "layer" a) nil)
(Command "layer" "m" a "c" b a "")
(Command "layer" "t" a "s" a "c" b a "")
)
)</P>
<P>;;;
(DEFUN PXYP (TXT1)
(SETQ TXT1 (STRCAT "\n\r 程序命令: " TXT1 " -- XYP@bsedi.com"))
(PRINC TXT1)
(Princ)
);defun</P>
<P>;;;
(pxyp"ZCBH (组成编号)")
(princ)
;-------------------------------------------
;;;END</P>
<P>
</P>
<IMG src="http://www.mjtd.com/bbs/UploadFile/2004-9/2004922225416518.gif" border=0>
[此贴子已经被作者于2004-9-24 11:32:42编辑过]

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?[加入论坛]

×
jaffy27ly 发表于 2004-11-25 01:49 | 显示全部楼层
<>不是有目录文件的吗?</P><P>不过,楼主的精神值得赞赏</P>
回复 顶 踩

使用道具 举报

您需要登录后才可以回帖 登录 | [加入论坛]

本版积分规则

手机版|化工技术网- 赠人玫瑰 手有余香 ( 苏ICP备14035884号 )

GMT+8, 2026-12-1 18:08

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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