06-10-2024
06:05 PM
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Denunciar
06-10-2024
06:05 PM
I found this lisp routine norm.lsp that should change all the objects inside blocks to layer 0. Give this a try:
(defun c:norm (/ *error* adoc lst_layer func_restore-layers)
(defun *error* (msg)
(func_restore-layers)
(vla-endundomark adoc)
(princ msg)
(princ)
) ;_ end of defun
(defun func_restore-layers ()
(foreach item lst_layer
(vla-put-lock (car item) (cdr (assoc "lock" (cdr item))))
(vl-catch-all-apply
'(lambda ()
(vla-put-freeze (car item) (cdr (assoc "freeze" (cdr item))))
) ;_ end of lambda
) ;_ end of vl-catch-all-apply
) ;_ end of foreach
) ;_ end of defun
(vl-load-com)
(vla-startundomark
(setq adoc (vla-get-activedocument (vlax-get-acad-object)))
) ;_ end of vla-startundomark
(vlax-for item (vla-get-layers adoc)
(setq lst_layer (cons (list item
(cons "lock" (vla-get-lock item))
(cons "freeze" (vla-get-freeze item))
) ;_ end of list
lst_layer
) ;_ end of cons
) ;_ end of setq
(vla-put-lock item :vlax-false)
(vl-catch-all-apply '(lambda () (vla-put-freeze item :vlax-false)))
) ;_ end of vlax-for
(vlax-for blk (vla-get-blocks adoc)
(if (and (equal (vla-get-islayout blk) :vlax-false)
(equal (vla-get-isxref blk) :vlax-false)
) ;_ end of and
(progn
(vlax-for subent blk
(vla-put-layer subent "0")
(vla-put-color subent 0)
(vla-put-lineweight subent aclnwtbyblock)
(vla-put-linetype subent "byblock")
) ;_ end of vlax-for
) ;_ end of progn
) ;_ end of if
) ;_ end of vlax-for
(func_restore-layers)
(vla-endundomark adoc)
(princ)
) ;_ end of defunBefore running norm.lsp this is how your tag's with circles look like:
After running norm.lsp this is now the look after a REGEN: