@komondormrex
I and I suppose all others have difficulty viewing your posts as your formatting of codes always look far too to the right of code tags... Next time, please take some time to prettify codes as it may help both you and others that are looking at it...
Now I did it for you, but next time, please pay attention to what you post and how does it look like...
(defun c:lessen_rect_block_width_4_025 ( / points coordinates segments width_seg mid_point )
(or (not (vl-catch-all-error-p (vl-catch-all-apply (function vlax-get-acad-object) nil))) (vl-load-com))
(vlax-map-collection (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object)))
(function
(lambda ( block )
(vlax-map-collection block
(function
(lambda ( object )
(if
(and
(= "AcDbPolyline" (vla-get-objectname object))
(minusp (vlax-get object (quote closed)))
(= 4 (vlax-curve-getendparam object))
(not (setq points nil))
(setq coordinates (vlax-get object (quote coordinates)))
(not
(while coordinates
(setq points (append points (list (list (car coordinates) (cadr coordinates)))))
(setq coordinates (cddr coordinates))
)
)
(setq segments (mapcar (function list) points (append (cdr points) (list (car points)))))
(equal (distance (nth 0 points) (nth 2 points)) (distance (nth 1 points) (nth 3 points)) 1e-6)
(equal (apply (function distance) (nth 0 segments)) (apply (function distance) (nth 2 segments)) 1e-6)
(equal (apply (function distance) (nth 1 segments)) (apply (function distance) (nth 3 segments)) 1e-6)
(or
(equal 4 (apply (function distance) (nth (setq width_seg 0) segments)) 1e-6)
(equal 4 (apply (function distance) (nth (setq width_seg 1) segments)) 1e-6)
)
) ;_ end and
(vlax-put object (quote coordinates)
(apply (function append)
(apply (function append)
(mapcar
(function
(lambda ( segment )
(mapcar
(function
(lambda ( point )
(polar (setq mid_point (mapcar (function *) (list 0.5 0.5) (mapcar (function +) (car segment) (cadr segment)))) (angle mid_point point) 1.875)
)
) segment
)
)
) (list (nth width_seg segments) (nth (+ 2 width_seg) segments))
)
)
)
) ;_ end then
) ;_end if
)
)
) ;_end vlax-map-collection
)
)
) ;_end vlax-map-collection
(vla-regen (vla-get-activedocument (vlax-get-acad-object)) acactiveviewport)
(princ)
)
Marko Ribar, d.i.a. (graduated engineer of architecture)