Hello,
I made this lisp routine which offsets polylines on layers GBG1 and GBG2 and then hatches it.
When a polyline cannot be offsetted (because the distance is too large for a closed polyline to be offsetted to the inside), it errors and stops.
How can I let the routine skip those objects and continue?
; error: Automation Error. Description was not provided.
Code:
(defun c:ArcerenGebouwen (/ ss n gebouw obj1 ent2 offsetlijn1 obj2 offsetlijn2 offsetlijnen1 arcering1)
(vl-load-com)
(setq ss (ssget "x" '((0 . "LWPOLYLINE") (-4 . "<OR") (8 . "GBG1") (8 . "GBG2") (-4 . "OR>")))
n (1- (sslength ss))
);; setq
(while (>= n 0)
(setq obj1 (vlax-ename->vla-object (ssname ss n))
n (1- n)
);; setq
(vla-offset obj1 (- 1))
(setq ent2 (ssget "l"))
(setq offsetlijn1 (entlast))
(setq obj2 (vlax-ename->vla-object (ssname ent2 0)))
(vla-offset obj2 (+ 1))
(setq offsetlijn2 (entlast))
(setq offsetlijnen1 (ssadd))
(ssadd offsetlijn1 offsetlijnen1)
(ssadd offsetlijn2 offsetlijnen1)
(command "._hatch" "ansi31" "0.1" "0" offsetlijnen1 "")
(command "._erase" offsetlijnen1 "")
);; while
);; defun