假如一块内含多个块 子块又含有直线 园 等图元 我想批量提取子图元 圆CIRCLE的坐标,循环老是有问题,大侠们看看- (defun INSERT1 ( ENT11 / OBJ LST)
- (setq OBJ (vlax-ename->vla-object ENT11))
- (vlax-for X
- (vla-item
- (vla-get-blocks (vla-get-ActiveDocument(vlax-get-acad-object)))
- (vla-get-name OBJ)
- )
- (setq lst (cons (vlax-vla-object->ename X) LST))
- )
- LST
- )
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- (defun c:gczbh1 (/ p qianzhui blc zg ss i lst1t e kkkk ptlst ff )
- (setq blc (getint "\n请输入比例尺1:"))
- (setvar 'userr1 blc);设置比例尺
- (setq zg(* 0.002 blc));字高
- (defun get_inpoint (blockname)
- (setq in_point(cdr (assoc 10 (entget blockname))))
- in_point
- )
- (setq ss (ssget '((0 . "insert"))) )
- ;(setq jidian (getpoint "请选择基点:"))
- ;(setq fangx (getpoint jidian "请选择方向点:"))
- ;(setq angle1 (* (angle jidian fangx) 1))
- ;(command "_.rotate" ss "" jidian "r" jidian fangx (polar jidian 0 100))
- (setq i 0)
- (setq lsttt '())
- (setq lst '())
- (setq lstt '())
- (repeat (sslength ss)
- (setq insert_name (ssname ss i))
- (SETQ E (INSERT1 insert_name))
- (foreach x E
- ;;;;;;;;;;;;;;
- ;;;;;;;;;;;;;;;;
- (if (= (cdr (assoc 0(entget x))) "insert")
- (progn
- (setq PPP (INSERT1 x))
-
- (mapcar '(lambda (xxx)
- (if (= (cdr (assoc 0(entget xxx)) ) "CIRCLE" ) (progn
- (setq zhuobiao (cdr (assoc 10(entget xxx))))
- (setq lstt (append lstt (list zhuobiao))) ) )
- )
- ppp)
- )
- ;;;;;;;;;;;;;;;;;;;;;
- (if (= (cdr (assoc 0(entget x)) ) "CIRCLE" )
- (progn
- (setq zhuobiao (cdr (assoc 10(entget x))))
- (setq lstt (append lstt (list zhuobiao)))
- );;;;;;;;;;;;;;;;;;;;
- )
- )
- ;(setq e(get_inpoint insert_name))
-
- (setq lst (append lst lstt))
-
- (setq i (1+ i))
- )
- )
|