Something I came up with for someone close to 3 years ago.... It doesn't include the drawing of the rectangle part, but it will put the X part in as many 4-sided closed LWPolylines as you select, all at once. It also does the X parts on the current Layer, which can be different from that of the selected Polyline(s). [Should @ВeekeeCZ 's suggestion perhaps put the Lines on a different Layer, rather than give them an override color?]
;|
XinQuad.lsp [command name: XQ]
To draw an X of 2 Lines in a QUADrilateral Polyline.
[Typically to X in rectangles, but will draw Lines across opposite
vertices of any 4-sided closed LWPolyline, incl. w/ arc segment(s).]
Draws Lines on current Layer with all current Properties.
Works in WCS or any UCS.
Kent Cooper, 19 January 2017
|;
(defun C:XQ (/ pt plss n pl)
(defun pt (par)
(trans (vlax-curve-getPointAtParam pl par) 0 1)
); defun -- pt
(if (setq plss (ssget '((0 . "LWPOLYLINE") (90 . 4) (-4 . "&") (70 . 1))))
(repeat (setq n (sslength plss))
(setq pl (ssname plss (setq n (1- n))))
(command
"_.line" "_none" (pt 0) "_none" (pt 2) ""
"_.line" "_none" (pt 1) "_none" (pt 3) ""
); command
); repeat
); if
(princ)
); defun -- C:XQ
(vl-load-com)
(prompt "\nType XQ to draw X Lines in closed Quadrilateral Polyline(s).")
Kent Cooper, AIA