测绘南方Cass,CAD删除居民地(JMD)房屋内高程点 (GCD)
生活随笔
收集整理的這篇文章主要介紹了
测绘南方Cass,CAD删除居民地(JMD)房屋内高程点 (GCD)
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
(vl-load-com)
(alert "SW溫馨提示,代碼命令為:SCGC")
(defun LC:WH-vxs1 (e / i v lst)(setq i -1)(while(setq v (vlax-curve-getpointatparam e (setq i (1+ i))))(setq lst (cons v lst)))(LC:lst-dist-filter (reverse lst) 0.0)
)
(defun LC:lst-dist-filter (lst d / p1 p2 p3 nlst )(while lst(setq p1 (car lst)lst (cdr lst)nlst (cons p1 nlst)p2 (mapcar '- p1 (list d d))p3 (mapcar '+ p1 (list d d))lst (vl-remove-if '(lambda(x)(and (vl-every '>= p3 x p2)(<= (distance x p1) d))) lst)))nlst
)
(defun xyp-9Pt (ename site / MinPT MaxPT p1 p9 p5 p3 p7 p2 p4 p6 p8)(defun mid (p1 p2)(mapcar '(lambda (x) (* x 0.5)) (mapcar '+ p1 p2)))(setq ename (cond ((= (type ename) 'ENAME) (vlax-ename->vla-object ename))((= (type ename) 'VLA-OBJECT) ename)))(vla-getboundingbox ename 'MinPT 'MaxPT)(setq p1 (vlax-safearray->list MinPT)p9 (vlax-safearray->list MaxPT)p5 (mid p1 p9)p3 (if (< (car p9) (car p1))(list (car p1) (cadr p9) (caddr p1))(list (car p9) (cadr p1) (caddr p1)))p7 (if (< (car p9) (car p1))(list (car p9) (cadr p1) (caddr p9))(list (car p1) (cadr p9) (caddr p9)))p2 (mid p1 p3)p4 (mid p1 p7)p6 (mid p3 p9)p8 (mid p7 p9))(nth (- site 1) (list p1 p2 p3 p4 p5 p6 p7 p8 p9))
)
(defun c:SCGC (/ TEXTHEIGH JMDLST EN0 EN1 LAY SS UK I FWXEN PT PTS S1 EN11 STR1 S2 EN22 STR2 STR XBM TXTBM XDATA XDATA1 XDATA2)(setq en0 (car (entsel "\n 請點選一個范圍線:")))(setq en1 (car (entsel "\n 請點選一個高程點文字:"))) (setq ss (ssget (list (cons 0 "LWPOLYLINE") (cons 8 (cdr (assoc 8 (entget en0)))) (cons -4 "<or") (cons 70 1) (cons 70 129) (cons -4 "or>"))))(setq i -1)(while (setq fwxen (ssname ss (setq i (1+ i)))) (vla-zoomwindow (vlax-get-acad-object) (vlax-3D-point (polar (xyp-9Pt fwxen 1) pi 10)) (vlax-3D-point (polar (xyp-9Pt fwxen 9) 0 10))) (setq pts nil)(setq pts (LC:WH-vxs1 fwxen) pts (append pts (list (car pts))))(setq s1 (ssget "CP" pts (list (cons 0 (cdr (assoc 0 (entget en1)))) (cons 8 (cdr (assoc 8 (entget en1)))))))(if s1(command "erase" s1 "")))(princ)
)
總結
以上是生活随笔為你收集整理的测绘南方Cass,CAD删除居民地(JMD)房屋内高程点 (GCD)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: C语言小明申请QQ号码
- 下一篇: 数据时代的大数据技术,主要包括哪些内容?