BONJOUR

mon problème est le suivante : j'ai un dessine constitue de 4 rectangles insérés sous forme de bloc ,et je veux récupérer les cordonnes de sommets de chaque rectangles ,mais le problème que mon programme ne marche pas comme il faut (la premiere resultat se repete )
voila mon programme:
Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
(defun translate (ptins coordinate /)
(mapcar'+ ptins coordinate))

    (defun c:getdiss()
       (setq w (list (cons 0 "INSERT")))
       (setq listname (list))
       (setq a (ssget "x" w))    
       ;(setq z (entget b))
	   (setq num (sslength a))
	   (setq m 0)
	   (while (< m num)
	   (setq mm (ssname a m))
	   (setq m (1+ m))
	   ;(princ mm)
	   (setq listname(append listname(list mm)))
	   )	
	   ;(princ listname)
       (setq j 0)
	   (setq inserlist (list))
       (while (< j num)  
	   (setq z (entget (nth j listname)))
	   (setq ptins (cdr (assoc 10 z)))
	   (setq j (1+ j))
	   (setq inserlist (append inserlist (list ptins)))
	   )
	  ; (princ inserlist)
     ;  (setq f(cdr(assoc 2 z)))
        (setq y (entget (cdr( assoc -2 (tblsearch "block" "LE420" )))))
        (setq li (list))
        (setq le (length y)) 
	    (setq n 0)
        (repeat le
            (setq zz (car (nth n y)))
		
		    ;(setq n (1+ n))
		
	        (if (= zz 10)
	            (progn
	            (setq li
	            (append li
	            (list (cdr (nth n y)))))
		        )
		    )
	        (setq n (1+ n))
	    )
		(setq lcord (length li))
		(setq lins (length inserlist))		   
		(setq sname1 (list))
		(setq sname2 (list))
		(setq sname3 (list))
		(setq k 0)
		(setq s 0)
		(while ( < k lins)		
		        (
				    while (< s lcord)	
					
				    (setq sname1 (translate (nth s li) (nth k inserlist)))
					;(setq s (1+ s))
					(setq sname2 (append sname2 (list sname1)))
					(setq s (1+ s))					
			    )
			(setq sname3 (append sname3 (list sname2)))
			(setq s (1+ s))
		)
			(princ sname3)
            (princ)			
	)

cordialement.