uvb0jkllk1z.gif
调整行距hj,支持CAD文字、天正单行和多行文字、图块、属性字、天正标高、cad表格、cad尺寸
其中调整天正标高行距非常适合水、暖专业画系统图时,直接复制建筑立面标高来调整行距
部分代码来自论坛,感谢各位大神
技术含量不高,但是水平有限错误难免,如有问题请留言
现在乐筑天下不能上传附件 如果下面代码复制不能使用 请到晓东下载
-
- ;;调整行距hj 支持CAD文字、天正单行和多行文字、图块、属性字、天正标高、cad表格、cad尺寸
- (setq BGhangju nil)
- (defun c:hj ( / *error* a all b c e hangju1 hangju2 l m n p snap x x0 xyz xyz_new y y0 z)
- (defun *error* (msg) ;错误处理函数
- (if snap (setvar "osmode" snap)) ;恢复捕捉
- (if ( (nth 2 (assoc '10 c)) (nth 2 (assoc '10 b)))
- (progn
- (setq all (subst 'aa (nth l all) all))
- (setq all (subst 'bb (nth m all) all))
- (setq all (subst c 'aa all))
- (setq all (subst b 'bb all))
- (setq b c)
- )
- )
- (setq m (1+ m))
- )
- (setq l (1+ l))
- (setq m (1+ l))
- )
- (setq p (cdr (assoc '10 (car all))))
- (setq hangju2 2000) ;默认行距为2000,自行修改
- (if (or (= BGhangju 0) (= BGhangju nil))
- (if (setq BGhangju (getint (strcat "\n行距:")))
- (setq hangju2 BGhangju)
- )
- (if (setq hangju1 (getint (strcat "\n行距:")))
- (progn
- (setq hangju2 hangju1)
- (setq BGhangju hangju1)
- )
- (setq hangju2 BGhangju)
- )
- )
- (setq x0 (car p))
- (setq y0 (cadr p))
- (setq m 0)
- (setvar "cmdecho" 0) ;关闭命令行提示
- (vl-cmdf "undo" "be") ;命令开始标记
- (setq snap (getvar "osmode")) ;取得捕捉参数
- (setvar "osmode" 0) ;关闭捕捉
- (while (:")))
- (setq hangju2 BGhangju)
- )
- (if (setq hangju1 (getdist (strcat "\n行距:")))
|