CAD_Noob Posted July 6, 2022 Posted July 6, 2022 Hi all, is it possible to changed the xref colors based on the filename prefix? AR for archi set to 10, ME for mech color 15 etc... Quote
mhupp Posted July 6, 2022 Posted July 6, 2022 (edited) No you have to open xref and change it there. Or bind it to the drawing thus defeating the xref. If things are set to bylayer in the xref its possible. Edited July 6, 2022 by mhupp Quote
mhupp Posted July 6, 2022 Posted July 6, 2022 (edited) Test this out see if the commented entmod works. comment out the command line below to test. This first lists all xref layers. then checks them for AH or ME in their name. (defun C:color-xref (/ lay name match c) (vl-load-com) (vlax-for lay (vla-get-layers (vla-get-activedocument (vlax-get-acad-object))) (if (wcmatch (setq name (vla-get-name lay)) "*|*") (setq match (cons name match)) ) ) (setvar 'cmdecho 0) (foreach lay match (cond ((wcmatch lay "*AH*|*") (setq ent (entget (tblobjname "layer" lay))) (entmod (subst (cons 62 10) (assoc 62 ent) ent)) ) ((wcmatch lay "*ME*|*") (setq ent (entget (tblobjname "layer" lay))) (entmod (subst (cons 62 15) (assoc 62 ent) ent)) ) ) ) (setvar 'cmdecho 1) (princ) ) Edited July 8, 2022 by mhupp 2 Quote
CAD_Noob Posted July 7, 2022 Author Posted July 7, 2022 thanks a lot. tried this and it's working flawlessly. I will just need to add more xref names and colors inside the cond Quote
BIGAL Posted July 8, 2022 Posted July 8, 2022 mhupp ok for Bricscad (setq lay "DEFAULT") (setq ent (entget (tblobjname "layer" lay))) (entmod (subst (cons 62 30) (assoc 62 ent) ent)) 2 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.