本帖最后由 wmz 于 2014-10-26 14:51 编辑
 - ;;;加入编码
- (defun SetData (Obj Data / dxf)
- (setq dxf (entget obj))
- (setq data (list(list "SOUTH" (cons 1000 data))))
- (foreach x Data
- (regapp (car x))
- (entmod (append dxf (list(cons -3 (list x)))))
- )
- )
- ;;;画等高线
- (defun Hdgxhsa (lst n bh h blc / XX xk LAY YS e)
- (setq sw 34.26 BL (/ blc 1000.0))
- (setq LAY (if(>= h sw)"DGX""DSX")
- XK (*(IF(=(rem h 5)0)0.3 0.15)BL)
- YS (IF(=(rem h 5)0) 3 2)
- XX (if(>= h sw)"CONTINUOUS""X11")
- )
- (setq xDATA (cond ((and (= (rem h 5) 0)(= LAY "DGX")) "201102")
- ((and(/= (rem h 5) 0)(= LAY "DGX")) "201101")
- ((and (= (rem h 5) 0)(= LAY "DSX")) "186302")
- ((and(/= (rem h 5) 0)(= LAY "DSX")) "186301")
- )
- )
- (entmakex (append
- (list '(0 . "LWPOLYLINE")
- '(100 . "AcDbEntity")
- '(100 . "AcDbPolyline")
- (cons 8 LAY)
- (cons 62 Ys)
- (cons 90 n)
- (cons 6 xx)
- (cons 43 xk)
- (cons 38 h)
- (cons 70 (+ 132 bh))
- )
- (mapcar '(lambda (pt)(cons 10 pt)) lst))
- )
- (setq e (entlast))
- (SetData e xDATA)
- (command "_pedit" e "s" "");;;请问不用这一句如何实现这一句的功能?因为不用这一句线不能拟合,用这一句速度就慢了!
- )
|