- (defun c:imli (/)
- (setq ss (ssget "X"))
- (setq pli (ssnamex ss))
- (setq li (list))
- (foreach a pli
- (setq li
- (append li
- (list (cadr a))
- )
- )
- )
- (setq ali (list))
- (foreach o li
- (setq ali
- (append ali
- (list (entnext o))
- )
- )
- )
- (setq oli (list))
- (foreach ob ali
- (setq oli
- (append oli
- (list (cdr (assoc 1 (entget ob))))
- )
- )
- )
- (setq cli (list))
- (foreach c li
- (setq cli
- (append cli
- (list (cdr (assoc 10 (entget c))))
- )
- )
- )
- (setq cnt 0)
- (setq fli (list))
- (while (/= cnt (length cli))
- (setq fli
- (append fli
- (list (cons (nth cnt oli) (nth cnt cli)))
- )
- )
- (setq cnt (1+ cnt))
- )
- (setq slist (getstring t "\nEnter imovable limit point numbers: "))
- (setq lst (list))
- (while (setq pt (vl-string-search " " slist))
- (setq lst (cons (substr slist 1 pt) lst))
- (setq slist (substr slist (+ pt 2)))
- )
- (setq lst (reverse (cons slist lst)))
- (setq als (list)
- cnt 0
- )
- (while (/= cnt (length lst))
- (foreach a fli
- (setq als
- (append als
- (if (= (nth cnt lst) (car a))
- (list (cons 10 (cdr a)))
- )
- )
- )
- )
- (setq cnt (1+ cnt))
- )
- (setq vn (length als))
- (setq adl (list '(0 . "LWPOLYLINE")
- '(100 . "AcDbEntity")
- '(100 . "AcDbPolyline")
- (cons 90 vn)
- '(70 . 1)
- )
- adf (list '(210 0.0 0.0 1.0))
- enlist (append adl als)
- enlist (append enlist adf)
- )
- (entmake enlist)
- (princ)
- )
干得好!您必须输入“imli”以启动命令,然后系统会提示您输入定义不可移动极限的点号,您应该以“n1 n2 n3”的形式输入点号,不带引号,并且在它们之间留有空格!如果你有任何问题,请随时提问!顺便说一句,它根本没有调试,因此如果您在图形中有一条多段线,您将遇到一些困难,因此最好在执行命令时更改图层并冻结多段线图层!
关于CAD_89! |