Hi.
Is there a way for adjusting the angle for hatch to align with the hatch boundary? I understand the Hatch origin principles but I there doesn't;t seem to be a way of getting the appropriate without guesswork. I am trying to hatch patios on a site plan and, like all sites, properties are at many different angles and it would be helpful if the hatch command allowed for the angle of the cross hatch I need to automatically snap to align with the boundary.
Many thanks,
Neil
Hi @neillyditt ,
>>>>Is there a way for adjusting the angle for hatch to align with the hatch boundary?
Maybe rotate UCS before hatching? I mean you can create temporary UCS aligned with the boundary before using HARCH command.
Not sure if this lisp will run on your Mac but give it a try.
It should allow you to select a closed pline assuming it has 4 sides that's rotated at a different angle and then it'll change the hatch angle to match for you as you start the hatch command:
; HatchSetAng selects closed rectangular pline to change hatch angle then run hatch command
; OP:
; https://forums.autodesk.com/t5/autocad-for-mac-forum/hatch-angle/m-p/13202997#M49227
(defun c:HatchSetAng (/ ang p1w p2w pln rtd)
(defun rtd (a) (/ (* a 180.0) pi))
(while (not pln)
(princ"\nSelect Closed Boundary Pline...")
(if (setq pln (ssget "_+.:E:S" '((-4 . "<AND") (0 . "*POLYLINE")(90 . 4)(-4 . "<OR")(70 . 1)(70 . 129)(-4 . "OR>")(-4 . "AND>")))) ; select closed pline
(setq pln (ssname pln 0))
(setq pln nil)
)
)
(command "_.UCS" "_OB" pln)
;;; taken from
;;; https://www.cadtutor.net/forum/topic/3635-current-ucs-numeric-angle-rads-or-degs/
(setq p1w (trans '(0 0 0) 1 0)
p2w (trans '(10 0 0) 1 0)
ang (rtd (angle p1w p2w))
)
(command "_.UCS" "_W")
(command "_.HPANG" ang)
(initcommandversion)
(command "_.Hatch" "_S" pln)
)
Can't find what you're looking for? Ask the community or share your knowledge.