
- ;; 优化后的代码
- (defun c:test1247 (/ fn pt lst a bh w hi h2)
- (xyp-CMDLASC0)
- (defun aaa (pt bh w h1 h2 / p2 p3 p4)
- (setq p2 (xyp-Pt2X pt w)
- p3 (xyp-Pt2Y p2 (- h2))
- p4 (xyp-Pt2Y pt (- h1))
- )
- (xyp-Pline (list pt p2 p3 p4) t)
- (xyp-Text 5 (inters pt p3 p2 p4 nil) bh)
- )
- (if (and (setq fn (getfiled "选取数据文件: " "" "xls" 16))
- (setq pt (getpoint "\n基点<退出>: "))
- )
- (foreach a (cdr (xyp-Xls2List fn))
- (setq bh (nth 0 a)
- w (atoi (nth 1 a))
- h1 (atoi (nth 2 a))
- h2 (atoi (nth 3 a))
- tx (aaa pt bh w h1 h2)
- pt (xyp-Pt2X pt (+ w 1000))
- )
- )
- )
- (xyp-CMDLA1)
- )
|