If more than 1 attribute say 2
(vla-put-textstring (car (vlax-invoke blk 'getattributes)) "test")
(setq atts (vlax-invoke blk 'getattributes))
(vla-put-textstring (nth 0 atts) "Test1") ; can use (car atts)
(vla-put-textstring (nth 1 atts) "Test2") ; can use (cadr atts)
; for multi atts find easier to use nth method
So you could use one of these: https://stackoverflow.com/questions/36852628/autolisp-entity-data-retrieval/48857993#48857993 massoc functions to get the coordinates of the polyline, and loop though this list to work out the distance between points - the largest distance will give you the mirror line. Should be simple then to use (command "mirror"..... ) afterward.
To my observation at first glance d1 must be equal to d2, and radius r is half d1 (d2)... Also if D is smaller side of rectangle, then :
d=d1=d2
r=d/2
(rem D d)=0, or n=D/d, and n=(fix n), and n E (1,3,5,7,9,...,(2*k+1)); k E (0,1,2,3,...)
So real unknown variable is n