本帖最后由 skg123 于 2012-12-18 11:51 编辑
一般道路都是数十公里,图面很难全部显示出来(全部显示是局部看不清楚)。本程序用于查找 指定的桩号;By Zo Roo-
- ;By Zo Roo 2011-6-13
- ;适用于公路桩号查询,方便在查找指定的桩号,如K35+200在中线的位置;
- ;06-13增加局部视图显示
- (vl-load-com)
- (defun C:zhcz ()
- (setvar "osmode" 0);关闭对象捕捉
- (prompt "By Zo Roo,2011-05-28,查询指定桩号的位置,命令C:zhcz;ESC键退出程序!")
- (setq en (entsel "\n选择道路中心线: "))
- (setq curve-obj (vlax-ename->vla-object (car en)))
- (setq leng (vlax-curve-getDistAtParam
- curve-obj
- (vlax-curve-getEndParam curve-obj)
- )
- )
- (if (= nil (setq a (getreal "\n请输入起点桩号<0>:"))) (setq a 0))
- (setq b (getreal "\n请输入需查询的桩号:"))
- (if (or (< b a) (> b (+ leng a)))
- (setq b (getreal "\n查询桩号不在公路范围内,请重新输入:"))
- b
- )
- (setq pt2 (vlax-curve-getPointAtDist obj (- b a)))
- (command "_zoom" "_c" pt2 50);增加局部视图显示
- (command "pline" pt2)
- (setvar "osmode" 703);恢复对象捕捉
- )
|