Message 1 of 5
About presspull
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all.
command rectang 0,0 100,100
With the squares drawn, I get
In test1, I can successfully extrude it, but in test2, I get an error.
Why is this?
Please help me.
(defun c:test1 (/ th id vrs cent)
(setq th 5)
(setq id (car (entsel)))
(setq vrs (vl-remove-if '(lambda (x) (/= (car x) 10)) (entget id)))
(setq cent (mapcar '/ (list (apply '+ (mapcar 'cadr vrs))
(apply '+ (mapcar 'caddr vrs)))
(list (length vrs) (length vrs))))
(setq cent (list (car cent) (cadr cent) 0.0))
(command "_.presspull" cent th "")
)
(defun c:test2
( / th pt1 pt2 ss nn i id vrs cent)
(setq th 5)
(setq pt1 (getpoint "\nSelect area : "))
(setq pt2 (getcorner pt1 "\nAnother corner :"))
(setq ss (ssget "_C" pt1 pt2(list (cons 0 "LWPOLYLINE"))))
(setq nn (sslength ss))
(setq i 0)
(while (< i nn)
(setq id (ssname ss i))
(setq vrs (vl-remove-if '(lambda (x) (/= (car x) 10)) (entget id)))
(setq cent (mapcar '/ (list (apply '+ (mapcar 'cadr vrs))
(apply '+ (mapcar 'caddr vrs)))
(list (length vrs) (length vrs))))
(setq cent (list (car cent) (cadr cent) 0.0))
(command "_.presspull" cent th "")
(setq i ( 1+ i))
)
)
Saitoib