adeladel Posted December 30, 2023 Posted December 30, 2023 (edited) PLS....... I WANT A LISP, FOR REDUCING THE VERTEX POINTS ON A POLYLINE RECTANGLE TO MINIMUM (4 VIRTIX ONLY) TO GET FOR EXAMPLE ONE DIMENSION OF EACH SIDE OF RECTANGLE , WHEN I PICKED IT NOT TWO OR THREE IN CASE OF THERE IS MORE VIRTIX ..I TRY SOME LISP AND COMMAND LIKE OVERKILL ITS LEAVE ONE VERTIX ..AND IT'S NOT EFFECTIVE ..I PREFER TO MAKE SELECTION TO MANY RECTANGLES AT SAME TIME.. .AND THANKS FOR ANYONE HELPING ME.. Edited December 30, 2023 by adeladel Quote
BIGAL Posted December 30, 2023 Posted December 30, 2023 (edited) When posting if you use capitals it is known as speaking loudly. Post a sample dwg or at least an image so we can see what you want. Edited December 30, 2023 by BIGAL 1 Quote
adeladel Posted December 31, 2023 Author Posted December 31, 2023 I attach the dwg file there is a lot of vertix in the rectangle ..and thanks for help, and I speak slowly now..(I apologize I don't know this role because this is not my mother language..) new blockrec.dwg Quote
Steven P Posted December 31, 2023 Posted December 31, 2023 'Diet' might be what you are looking for: 1 Quote
Tsuky Posted December 31, 2023 Posted December 31, 2023 This can help you? (defun c:remove-vertex ( / ss n objent area_ori vertexlist v_list epoint cnt newlist index indexlist) (setq ss (ssget '((0 . "LWPOLYLINE")))) (cond (ss (repeat (setq n (sslength ss)) (and (setq objent (vlax-ename->vla-object (ssname ss (setq n (1- n)))) area_ori (vla-get-area objent) vertexlist (vlax-get objent "Coordinates") v_list vertexlist ) (not (zerop area_ori)) (repeat (/ (length v_list) 2) (setq epoint (list (car v_list) (cadr v_list)) cnt 0 newlist '() index (* 2 (fix (+ 0.5 (vlax-curve-getparamatpoint objent epoint)))) indexlist (list index (1+ index)) ) (foreach ordinate vertexlist (if (not (vl-position cnt indexlist)) (setq newlist (cons ordinate newlist)) ) (setq cnt (1+ cnt)) ) (not (vl-catch-all-apply 'vlax-put (list objent "Coordinates" (reverse newlist)) ) ) (if (equal (vla-get-area objent) area_ori 1E-08) (setq vertexlist (vlax-get objent "Coordinates")) (not (vl-catch-all-apply 'vlax-put (list objent "Coordinates" vertexlist) ) ) ) (setq v_list (cddr v_list)) ) ) ) ) ) ) 1 Quote
adeladel Posted December 31, 2023 Author Posted December 31, 2023 Thanks a lot for help , Its worked and solve my problem and will save a lot off time for me..I am very grateful to you and I appreciate your time and effort for helping me.. Quote
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.