JORYROJ Posted September 28, 2011 Share Posted September 28, 2011 hi guys, do you have any idea how to create multiple wipeout with different rectangle sizes? for example: I have 300 rectangles with different sizes I want to convert all the rectangles into wipeouts Is there a way that it can be done in just one selection? I,ve tried using ALL in selection but it only convert just one rectangle. Can you give mi a tip or an Lisp maybe. thanks Quote Link to comment Share on other sites More sharing options...
Lt Dan's legs Posted September 28, 2011 Share Posted September 28, 2011 (defun c:test ( / ss ) (defun ss->lst ( ss flag / id lst ) (if (eq 'PICKSET (type ss)) (repeat (setq id (sslength ss)) ( (lambda ( name ) (setq lst (cons (if flag (vlax-ename->vla-object name) name )lst ) ) )(ssname ss (setq id (1- id))) ) ) ) ) (if (setq ss (ss->lst (ssget '((0 . "lwpolyline")(70 . 1))) nil ) ) (foreach x ss (makewipeout (ent2ptlst x) (cdr (assoc 210 (entget x))) ) (entdel x) ) ) (princ) ) ;;; ENT2PTLST ;;; Returns the vertices list of the polygon figuring the curve object ;;; Coordinates defined in OCS (defun ent2ptlst (ent / obj dist n lst p_lst prec) (vl-load-com) (if (= (type ent) 'ENAME) (setq obj (vlax-ename->vla-object ent)) ) (cond ((member (cdr (assoc 0 (entget ent))) '("CIRCLE" "ELLIPSE")) (setq dist (/ (vlax-curve-getDistAtParam obj (vlax-curve-getEndParam obj) ) 50 ) n 0 ) (repeat 50 (setq lst (cons (trans (vlax-curve-getPointAtDist obj (* dist (setq n (1+ n)))) 0 (vlax-get obj 'Normal) ) lst ) ) ) ) (T (setq p_lst (vl-remove-if-not '(lambda (x) (or (= (car x) 10) (= (car x) 42) ) ) (entget ent) ) ) (while p_lst (setq lst (cons (append (cdr (assoc 10 p_lst)) (list (cdr (assoc 38 (entget ent)))) ) lst ) ) (if (/= 0 (cdadr p_lst)) (progn (setq prec (1+ (fix (* 25 (sqrt (abs (cdadr p_lst)))))) dist (/ (- (if (cdaddr p_lst) (vlax-curve-getDistAtPoint obj (trans (cdaddr p_lst) ent 0) ) (vlax-curve-getDistAtParam obj (vlax-curve-getEndParam obj) ) ) (vlax-curve-getDistAtPoint obj (trans (cdar p_lst) ent 0) ) ) prec ) n 0 ) (repeat (1- prec) (setq lst (cons (trans (vlax-curve-getPointAtDist obj (+ (vlax-curve-getDistAtPoint obj (trans (cdar p_lst) ent 0) ) (* dist (setq n (1+ n))) ) ) 0 ent ) lst ) ) ) ) ) (setq p_lst (cddr p_lst)) ) ) ) lst ) ;;; MakeWipeout creates a "wipeout" from a points list and the normal vector of the object (defun MakeWipeout (pt_lst nor / dxf10 max_dist cen dxf_14) (if (not (member "acwipeout.arx" (arx))) (arxload "acwipeout.arx") ) (setq dxf10 (list (apply 'min (mapcar 'car pt_lst)) (apply 'min (mapcar 'cadr pt_lst)) (caddar pt_lst) ) ) (setq max_dist (float (apply 'max (mapcar '- (apply 'mapcar (cons 'max pt_lst)) dxf10) ) ) ) (setq cen (mapcar '+ dxf10 (list (/ max_dist 2) (/ max_dist 2) 0.0))) (setq dxf14 (mapcar '(lambda (p) (mapcar '/ (mapcar '- p cen) (list max_dist (- max_dist) 1.0) ) ) pt_lst ) ) (setq dxf14 (reverse (cons (car dxf14) (reverse dxf14)))) (entmake (append (list '(0 . "WIPEOUT") '(100 . "AcDbEntity") '(100 . "AcDbWipeout") '(90 . 0) (cons 10 (trans dxf10 nor 0)) (cons 11 (trans (list max_dist 0.0 0.0) nor 0)) (cons 12 (trans (list 0.0 max_dist 0.0) nor 0)) '(13 1.0 1.0 0.0) '(70 . 7) '(280 . 1) '(71 . 2) (cons 91 (length dxf14)) ) (mapcar '(lambda (p) (cons 14 p)) dxf14) ) ) ) Quote Link to comment Share on other sites More sharing options...
Tharwat Posted September 28, 2011 Share Posted September 28, 2011 Check this out ... (defun c:TesT (/ ss i sset) (if (setq ss (ssget "_:L" '((0 . "LWPOLYLINE,POLYLINE")))) (repeat (setq i (sslength ss)) (setq sset (ssname ss (setq i (1- i)))) (if (vlax-curve-isclosed sset) (command "_.wipeout" "_polyline" sset "_Y") ) ) (princ) ) (princ) ) Tharwat Quote Link to comment Share on other sites More sharing options...
Lt Dan's legs Posted September 28, 2011 Share Posted September 28, 2011 Tharwat, try using an asterisk ;;like this (ssget "_:L" '((0 . "*text"))) ;or (ssget "_:L" '((0 . "*polyline"))) Quote Link to comment Share on other sites More sharing options...
Tharwat Posted September 28, 2011 Share Posted September 28, 2011 Tharwat' date=' try using an asterisk ;;like this (ssget "_:L" '((0 . "*text"))) ;or (ssget "_:L" '((0 . "*polyline"))) [/quote'] Agreed That was done quickly as a matter of habit only .. Thanks Quote Link to comment Share on other sites More sharing options...
JORYROJ Posted September 28, 2011 Author Share Posted September 28, 2011 thanks guys, Tharwat the lisp works just perfect, it only takes me 5seconds to finish an hour work. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted September 28, 2011 Share Posted September 28, 2011 thanks guys, Tharwat the lisp works just perfect, it only takes me 5seconds to finish an hour work. You're welcome any time buddy . Tharwat Quote Link to comment Share on other sites More sharing options...
BRUNO FALCON Posted September 6 Share Posted September 6 Hi guys, and thank you for sharing this very helpful lisp, do you have one for multiple circles, Kind regards, Bfr Quote Link to comment Share on other sites More sharing options...
SLW210 Posted September 6 Share Posted September 6 Try this Circular Wipeout | Lee Mac Programming Quote Link to comment Share on other sites More sharing options...
exceed Posted September 6 Share Posted September 6 or try justwipe https://cadtips.cadalyst.com/2d-operations/create-wipeouts-two-ways Quote Link to comment Share on other sites More sharing options...
SLW210 Posted September 6 Share Posted September 6 5 minutes ago, exceed said: or try justwipe https://cadtips.cadalyst.com/2d-operations/create-wipeouts-two-ways Doesn't seem to work for circles. Quote Link to comment Share on other sites More sharing options...
SLW210 Posted September 6 Share Posted September 6 If you set your Hatch to Solid, color 255,255,255 and selection method to Objects, it is just as good as a wipeout and doesn't have the issue of only polylines. Quote Link to comment Share on other sites More sharing options...
exceed Posted September 6 Share Posted September 6 33 minutes ago, SLW210 said: Doesn't seem to work for circles. \\ there is no option to wipe while creating a circle like Lee Mac's, but justwipe's option S(selection) is works for circle. i think when user wants wipeout on "multiple" circles, it is usually applied for visibility of multiple bubble circles and that already exist, so I think justwipe's option is also valid. Quote Link to comment Share on other sites More sharing options...
SLW210 Posted September 6 Share Posted September 6 I get this in AutoCAD 2022 with JustWipe. Quote Link to comment Share on other sites More sharing options...
SLW210 Posted September 6 Share Posted September 6 Here is C2Wipe from Lee Macs. Quote Link to comment Share on other sites More sharing options...
SLW210 Posted September 6 Share Posted September 6 Here is a Solid Hatch with the same color as the background. Quote Link to comment Share on other sites More sharing options...
exceed Posted September 7 Share Posted September 7 (edited) 8 hours ago, SLW210 said: I get this in AutoCAD 2022 with JustWipe. It's interesting. GIF I posted was executed in autocad 2023. in the code, the implementation of dividing the circle 50 times is the same. I think it might be affected by the user environment because this code use the "command" pline.... I agree with it's better use entmakex and trans points Lee Mac's way. Edited September 7 by exceed Quote Link to comment Share on other sites More sharing options...
SLW210 Posted September 8 Share Posted September 8 I played with it some more and got all types of shapes, but never a complete circle. When I get back to work, I'll see if I can get a full circle. At any rate for my needs, a solid hatch is just as good if not better most times as well as Lee Mac's, still, the more options the better as far I am concerned. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.