本帖最后由 kwok 于 2014-4-15 20:39 编辑
简单的,自已可以按要求再深化,如偏到图层改色等... - (defun c:tt (/ w pline )
- (vl-load-com)
- (command ".undo" "be")
- (setq w (getreal "\n 双偏宽度<1000.0>: "))
- (if (null w) (setq w 1000))
- (vl-cmdf ".spline")
- (while (= 1 (getvar "cmdactive"))
- (vl-cmdf pause)
- )
- (setq pline (entlast))
- (vla-Offset (vlax-ename->vla-object pline) (/ w 2.0))
- (vla-Offset (vlax-ename->vla-object pline) (/ w -2.0))
- (command "chprop" pline "" "lt" "center" "s" 200 "");;;中心线比例200,提示没有center手动加载一下,一般不用的.
- (command ".undo" "e")
- (princ)
- )
|