马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×

- (defun c:bzh(\ id p1 p2 x1 y1 x2 y2 dt_x dt_y
- code1 code2 code3 code4 code h_real)
- ;配合cx.shx标注室外和室内标高、坐标、坡度
- ;以后将id设置为公共变量,加入当前字体识别程序
- (princ "本程序主要配合cx.shx开发,如果使用其他字体,请修改相应字符代码")
- (setq id (getint "\n室内标高1/室外标高2/坐标3/坡度4 <1>"))
- ;加入循环
- (cond
- ((= id 1);室内标高
- (setq code1 "%%156" code2 "%%158" code3 "%%159" code4 "%%157")
- (setq p1 (getpoint "\n请输入标高标注位置:"))
- (setq p2 (getdist p1 "\n 请示意数值位置:"))
- (setq x1 (car p1) y1 (cadr p1)
- x2 (car p2) y2 (cadr p2))
- (princ (strcat "\n请输入标高数值<" (rtos y1 2 3) ">"))
- (setq h_real (getreal))
- (if (= h_real nil)
- (setq h_real y1)
- )
- (setq dt_x (- x2 x1) dt_y (- y2 y1))
- (if (and (> dt_x 0) (> dt_y 0));第一像限
- (setq code code1)
- )
- (if (and (> dt_x 0) (< dt_y 0));第二像限
- (setq code code2)
- )
- (if (and (< dt_x 0) (< dt_y 0));第三像限
- (setq code code3)
- )
- (if (and (< dt_x 0) (> dt_y 0));第四像限
- (setq code code4)
- )
- (command "text" p1 "" "" (strcat code (rtos h_real 2 3)))
- )
- ((= id 2);室外标高
- )
- ((= id 3);坐标
- )
- ((= id 3);坡度
- )
- (t nil);其余
- )
- (princ "/n感谢使用!")
- )
|