CASS扩展属性丢失
相信大家在工作中,可能都遇到过图形属性丢失的情况吧。想恢复非常的麻烦,本人想通过程序来实现恢复属性:比方房屋通过文字注记来识别并恢复属性,点状物用图块名来识别,有些线状物用线性来识别。当然还是有部分无法恢复,但是毕竟是少数了。请个位高手出来帮忙。下面这是一个写入宗地属性的代码,很好用,以上也是受此程序启发:(defun c:zdsx ( / elist i name num pts qs s1 s2 ss ss0 str1 str2 x xdata)(setvar "pickstyle" 0)(if (and (setq ss0 (ssget '((0 . "LWPOLYLINE"))))(setq i -1))(while (setq qs (ssname ss0 (setq i (1+ i)))) (progn (setq elist (entget qs '("*")) elist (vl-remove (assoc -3 elist) elist) pts (mapcar 'cdr (vl-remove-if '(lambda (x) (/= (car x) 10) ) (entget qs) ) ) ss (ssget "cp" pts '((0 . "text"))) s1 (ssname ss 0) s2 (ssname ss 1) str1 (cdr (assoc 1 (entget s1))) str2 (cdr (assoc 1 (entget s2))) ) (if (> (ascii (substr str1 1 1)) 159)(progn (setq name (cons 1000 (cdr (assoc 1 (entget s1))))) (setq num (cons 1000 (cdr (assoc 1 (entget s2))))))(progn (setq name (cons 1000 (cdr (assoc 1 (entget s2))))) (setq num (cons 1000 (cdr (assoc 1 (entget s1)))))) ) (regapp "SOUTH") (setq xdata (list -3 (list "SOUTH" (cons 1000 "300000") num name (cons 1000 "072") ) ) ) (entmod (append elist (list xdata) ) ) )))(setvar "pickstyle" 1));根据宗地内的宗地号和权利人写入宗地扩展属性,地类默认072挺好用的,
页:
[1]