Hi, @paullimapa
There is actually no line above this fragment, which means a variable that receives the selection of what was previously created and stores it, so that it can later recognize the limits and place the solid hatch, as exemplified by @komondormrex the solid hatch depends on you determining the limit points, and the entBefore function does this storage so that the solid hatch is applied. That's why in my video when I use the function directly it gives an error, and with this proposition I store the object to apply the solid.
I don't know if I explained it well.
example:
;points of the rectangle
(setq rectPts (list (polar (polar pt ra(/ fa -2)) (+ ra (/ pi 2)) (/ FE_width 2))
(polar (polar pt ra(/ fa 2)) (+ rectAngle (/ pi 2)) (/ fw2))
(polar (polar pt ra(/ fa 2)) (+ rectAngle (/ pi 2)) (/ fw-2))
(polar (polar pt ra(/ fa -2)) (+ rectAngle (/ pi 2)) (/ fw-2))))
;; Stores the last entity before the PLINE command
(setq entBefore (entlast))
;; Draw the strip rectangle (closed polyline)
(command "_.PLINE" (car rectPts) (cadr rectPts) (caddr rectPts) (cadddr rectPts) "C")
;; Stores the last created entity (strip rectangle)
(setq entAfter (entlast))
(setq rectEnt (if (/= entBefore entAfter) entAfter nil))
;; If rectangle was created, apply color and hatch properties
(if rectEnt (progn (command "_.CHPROP" rectEnt "" "Color" "253" "")
(command "_.HATCH" "SOLID" rectEnt "") ;; Hatch solid
(setq hacEnt (entlast))
(command "_.CHPROP" hacEnt "" "Color" "253" "") ));; Hatch color same contour
ent + Before