fixed sephatch if no hatch in the file

This commit is contained in:
2019-12-09 02:00:33 +01:00
parent 7371c969cf
commit 5643168f2a

View File

@@ -75,6 +75,8 @@
(defun sephatch (/ ss i il imax currElem layerName newLayerName layerSettings newLayerSettings newLayer newElem) (defun sephatch (/ ss i il imax currElem layerName newLayerName layerSettings newLayerSettings newLayer newElem)
(graphscr) (graphscr)
(setq ss (ssget "_A" '((0 . "HATCH")))) (setq ss (ssget "_A" '((0 . "HATCH"))))
(if ss
(progn
(setq il (sslength ss));length of selection (setq il (sslength ss));length of selection
(setq i 0);counter to zero (setq i 0);counter to zero
(setq imax 1);while variable (setq imax 1);while variable
@@ -93,6 +95,8 @@
(setq i (1+ i));increments i (setq i (1+ i));increments i
(if (= i il) (setq imax nil));finish function if i equals il (if (= i il) (setq imax nil));finish function if i equals il
) )
)
)
(princ) (princ)
) )