马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
;| 用途:修改尺寸标注为楼梯标注形式。例如,你如果选择了标注值分别为1650和1800的相关标注,输入步长为150,则标注值分别被改为“150X11=1650”和“150X12=1800”。
使用方法十分简单:
1.选择要改变的尺寸标注;
2.输入步长或踏步数,默认步长为260;
3.回车即完成了修改。
如紧接着再次使用该命令,则默认的范围为上次使用的步长。|;
- (princ "\n修改尺寸标注为楼梯标注形式,\n比例为1:50,请执行ltdim;\n比例为1:100,请执行ltdim1。")
- (defun c:ltdim(/ ss nn ssl n sn en p1 p2 dis3 dis0 t0 t1 t b m bs ms dis00 str)
- ;;全局变量: wxn0
- (setq oer *error* *error* myerr)
- (setvar "cmdecho" 0)
- (command "graphscr")
- (setq ss (ssget))
- (if (= wxn0 nil) (setq wxn0 260))
- (princ "\n步长或步数<") (princ wxn0)
- (setq nn (getint ">:"))
- (if (= nn nil) (setq nn wxn0))
- (setq ssl (sslength ss) n 0)
- (repeat ssl
- (setq sn (ssname ss n) en (entget sn) n (1+ n))
- (if (= "DIMENSION" (cdr (assoc 0 en)))
- (progn
- (setq p1 (cdr (assoc 13 en)) p2 (cdr (assoc 14 en))
- dis3 (distance p1 p2) dis0 (* 5 (fix (/ (+ dis3 4) 10)))
- t0 (/ dis3 nn) t0 (/ t0 2) t1 (+ t0 0.5) t (fix t1)
- )
- (if (> nn t) (setq b nn m t) (setq m nn b t))
- (setq bs (itoa b) ms (itoa m) diss0 (itoa dis0))
- (setq str (strcat bs "X" ms "=" diss0))
- (command "dim1" "newtext" str sn "")
- (setq wxn0 nn)
- )
- )
- (princ (strcat str "; "))
- )
- (princ "\n gysjy0 96.8制作, 97.5修改.")
- (setq *error* oer)
- (princ))
- (defun c:ltdim1(/ ss nn ssl n sn en p1 p2 dis3 dis0 t0 t1 t b m bs ms dis00 str)
- ;;全局变量: wxn0
- (setq oer *error* *error* myerr)
- (setvar "cmdecho" 0)
- (command "graphscr")
- (setq ss (ssget))
- (if (= wxn0 nil) (setq wxn0 260))
- (princ "\n步长或步数<") (princ wxn0)
- (setq nn (getint ">:"))
- (if (= nn nil) (setq nn wxn0))
- (setq ssl (sslength ss) n 0)
- (repeat ssl
- (setq sn (ssname ss n) en (entget sn) n (1+ n))
- (if (= "DIMENSION" (cdr (assoc 0 en)))
- (progn
- (setq p1 (cdr (assoc 13 en)) p2 (cdr (assoc 14 en))
- dis3 (distance p1 p2) dis0 (* 10 (fix (/ (+ dis3 4) 10)))
- t0 (/ dis3 nn) t1 (+ t0 0.5) t (fix t1)
- )
- (if (> nn t) (setq b nn m t) (setq m nn b t))
- (setq bs (itoa b) ms (itoa m) diss0 (itoa dis0))
- (setq str (strcat bs "X" ms "=" diss0))
- (command "dim1" "newtext" str sn "")
- (setq wxn0 nn)
- )
- )
- (princ (strcat str "; "))
- )
- (princ "\n gysjy0 96.8制作, 97.5修改.")
- (setq *error* oer)
- (princ))
- (defun myerr (s)
- (if (/= s "Function canccelled")
- (if (= (substr s 1 13) "null function")
- (princ "\n该程序不能运行.") (princ "\n程序中止")
- )
- )
- (setq *error* oer)
- (princ))
|