Message 1 of 10
LISP to create boundaries for each hatch layer
Not applicable
04-20-2021
06:21 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi Everyone,
I'm trying to create a LISP routine to process every hatch within a drawing file. The steps required are:
>for each hatch layer in the drawing
>set it as the current layer
>then generate a polyline boundary
>save drawing
I want the routine iterate through each hatch layer and create a polyline on that hatch layer.
The hatches are nonassociative.
I'm new to LISP so below is a snippet with which I would appreciate some help:
(defun c:rehash ()
(vl-load-com)
(while (setq OBJ (ssname SSET (setq CNT (1+ CNT))))
(setvar 'clayer (cdr (assoc 8 (entget OBJ))))
(command "-hatchedit" OBJ "b" "r" "y")
(command "_.HATCHGENERATEBOUNDARY" hnd "")
)
)
(princ)
)