Message 1 of 7
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
(defun c:p2h (/ _addhatch _boundary b spc s)
(defun _addhatch (spc bnd lyr / h)
(if (setq h (vlax-invoke spc 'addhatch achatchobject "Solid" :vlax-true))
(progn (vlax-invoke h 'appendouterloop (list bnd))
(vla-put-layer h lyr)
(vla-evaluate h)
(vla-update h)
h
)
)
)
(defun _boundary (p / e)
(setq e (entlast))
(bpoly p)
(if (not (equal e (entlast)))
(entlast)
)
)
(cond
((setq s (ssget '((0 . "POINT"))))
(setq spc (vlax-ename->vla-object (cdr (assoc 330 (entget (ssname s 0))))))
(setvar 'cmdecho 0)
(command "_.undo" "_begin")
(foreach e (vl-remove-if 'listp (mapcar 'cadr (ssnamex s)))
(if (setq b (_boundary (cdr (assoc 10 (entget e)))))
(progn (_addhatch spc (vlax-ename->vla-object b) (cdr (assoc 8 (entget e)))) (entdel b))
)
)
(command "_.undo" "_end")
(setvar 'cmdecho 1)
)
)
(princ)
)
Solved! Go to Solution.