(defun c:plan-verificar ()
;----------------------------------------------------------------------------------------------------------------
; Verificar e criar layer
(if (= nil (tblsearch "layer" "0-CORRIGIR"))
(command "layer" "_n" "0-CORRIGIR" "_C" 2 "0-CORRIGIR" ""))
;----------------------------------------------------------------------------------------------------------------
; Verificar poligonos abertos
(setq quantcorrigir 0 )
(setq vlimites (ssget "_x" (list (cons 8 "LIMITE_CTO"))))
(setq quantlimites (sslength vlimites))
(setq cont8 0)
(repeat quantlimites
(progn
(setq entname (ssname vlimites cont8))
(setq valor (entget entname))
(setq valor70 (cdr (assoc 70 valor )))
(setq cont8 (+ cont8 1))
(setq vl (vlax-ename->vla-object (entlast)))
(vlax-put-property vl "Closed" :vlax-true) ;changes it to -1
(if (= valor70 0 )
(command "_change" "si" entname "P" "_LA" "0-CORRIGIR" "_LW" "0.5" ""))
))
(setvar "LWDISPLAY" 1 )
(setq vlimites1 (ssget "_x" (list (cons 8 "0-CORRIGIR"))))
(if (/= vlimites1 nil )
(setq quantcorrigir (sslength vlimites1)))
)
)