需求以下功能职:
框选闭合多线段(数量2000以上)
修改全部顶点表的座标精度:
如XXX.XXXXXXXX 更新为XXX.XXX
YYY.YYYYYYYY更新为YYY.YYY
子函数都找好了。。无奈太久没玩LISP。对不起大家的教导了
以下子程序摘自 自贡黄明儒
- ;;164.35 [功能] 多段线修改顶点 By 自贡黄明儒
- ;;示例(HH:ModifyVertex (car(setq en(entsel))) (cadr en) (getpoint))
- (defun HH:ModifyVertex (en pt newPt / ENT L1 L2 NPT P P10)
- (setq p (HH:PickClosePt en pt))
- (setq p10 (list 10 (car p) (cadr p)))
- (setq ent (entget en))
- (setq L2 (cdr (member p10 ent)))
- (setq L1 (reverse (cdr (member p10 (reverse ent)))))
- (setq Npt (list (list 10 (car newPt) (cadr newPt))))
- (entmod (append L1 Npt L2))
- )
- ;;(HH:ModifyVertex1 (car(setq en(entsel))) (cadr en)) By 自贡黄明儒
- (defun HH:ModifyVertex1 (en p / ENT GR L1 L2 NPT P10)
- (setq ent (entget en))
- (setq pt (HH:PickClosePt en p))
- (setq p10 (list 10 (car pt) (cadr pt)))
- (setq L2 (cdr (member p10 ent)))
- (setq L1 (reverse (cdr (member p10 (reverse ent)))))
- (while (and (setq gr (grread 5)) (= (car gr) 5))
- (setq Npt (list (list 10 (car (cadr gr)) (cadr (cadr gr)))))
- (entmod (append L1 Npt L2))
- )
- )
- ;-----------------------------------------------------
- ;;164.3 [功能] 多段线端点列表 By 自贡黄明儒
- ;;示例(HH:PtLists (car (entsel)))
- (defun HH:PtLists (en)
- (mapcar 'cdr
- (vl-remove-if-not '(lambda (x) (= (car x) 10)) (entget en))
- )
- )
|