@hak_vz wrote:
1) @Anonymous - "to show that difference by adding hatch (similar to the highlighter below) that changes hatch consistency (or layer)"
I guess she wants to use hatch pattern with different scale factor ("gravel"). Then using solid doesn't work
2) Horizontal and vertical scale are different
3) One may use hatch with different color, instead of layers.
....
1) As much a fault in yours as mine, using the Solid Hatch pattern. [Also, the (command) that does the Hatching is done differently in your different routines, and in some returns an unknown-pattern-name message for me in Acad2019 -- the proper sequence varies with version, as also differs if a hyphen is used before the command name.] So @Anonymous , is something like your image acceptable, with solid colors, or does it need to be a non-Solid Hatch pattern at different scales, or maybe different Hatch patterns?
2) Yes, but there are determinable slopes of exaggerated-vertical line segments that represent the break points between low and medium and steep slopes in reality -- it's just a matter of determining what the result of the division is for each break point, accounting for the exaggeration, and putting those as instructed in place of my arbitrary 0.25 and 0.5 [and more if they have more than 3 slope categories]. Those would need to be different for different vertical exaggerations, so if they use different ones, they would need to have different routines for each, or a prompt for the vertical exaggeration could be added, and the breakdown calculated from that. In any case, the range of slope within each category is needed to really finalize something.
IF it really needs to be a Hatch pattern at different scales, here's a way to do that, taking advantage of the fact that Hatch can let you draw the boundary directly, rather than have a pre-drawn object to pick. This one also puts the pattern at different rotation angles along with the different densities, to help differentiate, and that's one reason I chose not to use a pattern such as Gravel, where the rotation difference wouldn't be apparent. Again, it requires selection of a LWPolyline, and doesn't [yet] verify that.
(vl-load-com)
(defun C:HUS ; = Hatches Under Slope
(/ pline n p1 p2 slope)
(setq
pline (car (entsel "\nSelect slope profile Polyline: "))
depth (getdist "\nVertical depth of under-Hatching: ")
n 0
); setq
(repeat (1- (cdr (assoc 90 (entget pline))))
(setq
p1 (vlax-curve-getPointAtParam pline n)
p2 (vlax-curve-getPointAtParam pline (setq n (1+ n)))
slope (/ (abs (- (cadr p1) (cadr p2))) (abs (- (car p1) (car p2))))
); setq
(command "_.hatch" "_user")
(cond ;;; EDIT slope cut-off values and angles/spacings, add categories
((<= slope 0.25) (command "30" 20)); [low density for shallow slope]
((<= slope 0.5) (command "45" 15)); [medium density for medium slope]
((command "60" 10)); [high density for steep slope]
); cond
(command "_yes" "" "_no"
;; to double-hatch, direct-draw boundary, don't keep it
"_none" p1
"_none" p2
"_none" (polar p2 (* pi 1.5) depth)
"_none" (polar p1 (* pi 1.5) depth)
"_close"
"" ; Accept
); command
); repeat
(princ)
); defun
The same similar situation I set up before yields this:

You can change the spacing numbers and/or rotations to make the differences more obvious, and of course appropriate spacing numbers will depend on your typical drawing scale and drawing unit. [If you want a specific pattern, don't just change the pattern name, because the answers to prompts here are specific to the User-defined pattern.]
You could also use a different pattern for each slope category. You would need to put the pattern name into the (command) functions inside each slope (cond)ition, rather than in the one before the (cond)itions, and of course answer other prompts appropriately.
Kent Cooper, AIA