- UID
- 176094
- 积分
- 0
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2004-9-18
- 最后登录
- 1970-1-1
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
桥梁设计经常要写节段号之类,呵呵,瞎写了一个,有用就拿去...
(princ "\n本程序用于生成指定间距、方向、步长的数字(字母)列. start command with wbh,written by lyc,10/2007.")
(defun C:wbh ( / pt fx bc thsize xx yy nn mth begin i pt1 dist osm)
(setq thsize (getvar "textsize"))(setq i 0)
(setvar "cmdecho" 0)
(setq osm (getvar "osmode"))
(setvar "osmode" 0)
(setq pt (getpoint "\n请指定起始点:"))
(setq xx (car pt))(setq yy (cadr pt))
(setq mth (getint "\n请指定生成类型(1.数字/2.字母):<1>"))
(if (= mth nil) (setq mth 1))
(if (= mth 1)
(progn
(setq begin (getint "\n请指定起始数字:<1>" ))
(if (= begin nil) (setq begin 1))
)
(progn
(setq begin (getstring "\n请指定起始字母:<A>" ))
(if (= begin "") (setq begin "A"))
)
)
(setq bc (getreal "\n请输入间距:<10>"))
(if (= bc nil) (setq bc 10))
(setq dist (getreal "\n请输入步长:<1>"))
(if (= dist nil) (setq dist 1))
(setq nn (getint "\n请输入生成个数:<10>"))
(if (= nn nil) (setq nn 10))
(setq fx (getstring "\n请指定生成方向(X/Y):<X>"))
(if (= mth 1)
(progn ;;;;;;;;;;;;;11111111111111用于生成数字
(if (= fx "") (setq fx "x"))
(if (or (= fx "X") (= fx "x"))
(progn
(while (< i nn)
(setq pt1 (list xx yy))
(command "text" "j" "m" pt1 thsize 0 (rtos begin 2 0))
(setq i (+ i 1))
(setq begin (+ begin dist))
(setq xx (+ xx bc))
)
)
(progn
(while (< i nn)
(setq pt1 (list xx yy))
(command "text" "j" "m" pt1 thsize 0 (rtos begin 2 0))
(setq i (+ i 1))
(setq begin (+ begin dist))
(setq yy (+ yy bc))
)
)
)
);;;;;;;;;;;;;11111111111111用于生成数字
(progn ;;;;;;;;;;;;;2222222222222222用于生成字母
(if (= fx "") (setq fx "x"))
(if (or (= fx "X") (= fx "x"))
(progn
(while (< i nn)
(setq pt1 (list xx yy))
(command "text" "j" "m" pt1 thsize 0 begin )
(setq i (+ i 1))
(setq begin (chr ( fix (+ ( ascii begin) dist) ) ) )
(setq xx (+ xx bc))
)
)
(progn
(while (< i nn)
(setq pt1 (list xx yy))
(command "text" "j" "m" pt1 thsize 0 begin )
(setq i (+ i 1))
(setq begin (chr ( fix (+ ( ascii begin) dist) ) ) )
(setq yy (+ yy bc))
)
)
)
);;;;;;;;;;;;;2222222222222222222用于生成字母
)
(setvar "cmdecho" 1)(setvar "osmode" osm)
(princ)
) |
|