本帖最后由 树櫴希德 于 2015-12-19 10:50 编辑
- (DEFUN VXS (E /)
- (READ(CDR (ASSOC 1 (ENTGET E))))
- )
- ;(VL-SORT PZX '(lambda(E1 E2) (EQUAL E1 E2 ) ) )
- (DEFUN SAME (L1 / L2 l3);;;;;
- (WHILE L1 (IF(MEMBER (CAR L1)(CDR L1))(SETQ L2(APPEND L2 (LIST(CAR L1))))
-
- (SETQ L3(APPEND L3 (LIST(CAR L1))))
- )
- (SETQ L1(VL-REMOVE(CAR L1 )L1))
- )
- (append l2 l3))
- (DEFUN SAMETIMES (L1) ;;;;;;
- (MAPCAR'(LAMBDA(X)(CONS X(- (LENGTH L1)(LENGTH(VL-REMOVE X L1))))) l1))
- (defun c:wzfltj ( / lst newlst x1 x2 x3 pzx ssa ii no en ptb pzx)
- (setq ssa (ssget '((0 . "TEXT") (8 . "承台编号"))))
- (setq ii 0
- no 0
- )
- (repeat (sslength ssa)
- (setq en (ssname ssa ii)
- ptb (vxs en)
- pzx (append pzx (list ptb))
- ii (1+ ii) )
- )
-
- (setq lst nil newlst nil x1 0)
- (setq newlst (same(SAMETIMES PZX)))
- (setq x2 (getpoint "\起始位置"))
- (setq x3 (polar x2 0 12))
- (command "text" "j" "c" (polar x2 (* pi 0.5) 3) "2" "0" "种类" "")
- (command "text" "j" "c" (polar x3 (* pi 0.5) 3) "2" "0" "数量" "")
- (repeat (length newlst)
- (command "text" "j" "c" x2 "1.5" "0" (vl-princ-to-string (car (nth x1 newlst))) "")
- (command "text" "j" "c" x3 "1.5" "0" (vl-princ-to-string(cdr(nth x1 newlst))) "")
- (setq x2(polar x2 (* pi 1.5) 3))
- (setq x3 (polar x2 0 12))
- (setq x1(1+ x1))
- )
-
- (PRINC)
- )
-
|