I think you will need to fix them in the xref dwg. Likely they are blocks...


Registered forum members do not see this ad.
i have an xref that i want to change all colours to grey, if i select all layers in the layer state manager and change their colour there are still a few lines that are colured, i am assuming these are not coloured by layer, is there an easy way round this?
I think you will need to fix them in the xref dwg. Likely they are blocks...


thanks for the reply, in the end i used the command SETBYLAYER and selected the whole dwg. then changed the colour via layer manager.
Glad to hear you found a solution![]()
Registered forum members do not see this ad.
This code from kpblc is handy when the objects that are set to by layer are inside of blocks it does it for the whole dwg though so be carefull if there are some blocks you dont want by layer
Code:Author kpblc changes all blocks inserted in a dwg from by block/color to by layer. (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");edit-> removed force to layer 0 (vla-put-color subent 256) (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) (command "_regenall") (princ) ) ;_ end of defun
"The problem is stupidity. I am not saying there should be capital punishment for stupidity, but, why don't we just take the safety labels off of everything and let the problem solve itself? "
Bookmarks