MAKE ENTIRE DRAWING COLOR 8

MAKE ENTIRE DRAWING COLOR 8

smallƑish
Advocate Advocate
3,182 Views
11 Replies
Message 1 of 12

MAKE ENTIRE DRAWING COLOR 8

smallƑish
Advocate
Advocate

Looking for a program which can do,

 

Select all layers and change color to 8

Select all objects to make the color set by layer including blocks.

 

Hope it is possible to make an entire drawing to 08 color in one click.

 

When I get arch layout, I need to make it like an Xref ( but a block) to make MEP layouts .

 

KIndly have a look into the attached dwg.

 

0 Likes
Accepted solutions (1)
3,183 Views
11 Replies
Replies (11)
Message 2 of 12

TomBeauford
Advisor
Advisor

Why not just add a Plot Style that plots everything color 8?

Checking "Display plot styles" in the active Page Setup would make everything display color 8.

Those Plot Styles and Page Setups could be used for other drawings as well.

 

Lisp to toggle "Display plot styles" in the active layout by Tim Creary: http://forums.augi.com/showthread.php?t=75802&highlight=ShowPlotStyles#3

64bit AutoCAD Map & Civil 3D 2023
Architecture Engineering & Construction Collection
2023
Windows 10 Dell i7-12850HX 2.1 Ghz 12GB NVIDIA RTX A3000 12GB Graphics Adapter
0 Likes
Message 3 of 12

Kent1Cooper
Consultant
Consultant

@TomBeauford wrote:

Why not just add a Plot Style that plots everything color 8? ....


I suspect the intent is to do this to a drawing that will then be Xref'd or Inserted as background, and other stuff drawn over it [such as mechanical/electrical/plumbing consultants often do with architectural plan drawings].  They typically wouldn't want that other stuff to be plotted in color 8, so a Plot Style that does that with everything wouldn't do.  You could do something similar setting only the colors used in that source drawing to plot in color 8, IF the other stuff and all title blocks and so on are, without exception, all in colors that are not used in that source drawing, so that they can come out as intended in the plot.

 

@smallƑish , I suspect there are routines on this Forum and other websites to do exactly what you want [some possibly using other colors such as different grey shades] or something very similar, available for the Searching.

Kent Cooper, AIA
0 Likes
Message 4 of 12

TomBeauford
Advisor
Advisor
Yes, it depends on what withsreekanth is trying to do.

If the intent is to do this to a drawing that will then be Xref'd setting XREFOVERRIDE to 1 and modifying the color of the xref'd layers would be easy enough.

If the intent is to do this to a drawing that will then be Inserted using the SETBYLAYER command and modifying the color of the layers before inserting would work.
64bit AutoCAD Map & Civil 3D 2023
Architecture Engineering & Construction Collection
2023
Windows 10 Dell i7-12850HX 2.1 Ghz 12GB NVIDIA RTX A3000 12GB Graphics Adapter
0 Likes
Message 5 of 12

Kent1Cooper
Consultant
Consultant

@TomBeauford wrote:
....
If the intent is to do this to a drawing that will then be Inserted using the SETBYLAYER command and modifying the color of the layers before inserting would work.

Somehow I wasn't aware [or had forgotten -- I don't have much occasion to use it] that SETBYLAYER has the option to dig inside Blocks.  They would want to use the Settings option to do only color, not also linetype and maybe other properties, in case there are overrides of other properties involved that they want retained.

Kent Cooper, AIA
Message 6 of 12

smallƑish
Advocate
Advocate

Yes, Kindly have a look into the dwg file, to get a more clear picture.

0 Likes
Message 7 of 12

ВeekeeCZ
Consultant
Consultant
Accepted solution

Well, using XREFs seems much more appropriate for this job... or at least a Bind-ed Xref.

 

But here you go. All layers to gray, all objects color-by-layer. 

 

(defun c:DrawingAllGray ()
  (setvar 'setbylayermode 1)
  (command "_.-layer" "_unlock" "*" "_color" 8 "*" ""
	   "_.-setbylayer" "_all" "" "_no" "_yes")
  (setvar 'setbylayermode 255)
  (princ)
  )

 

 

If you ever change your mind and use an Xref, here's the variant for that.

 

(defun c:XrefLayGrey ( / e d)
  (setvar 'xrefoverride 1)
  (if (and (setq e (entsel "\nSelect XREF: "))
	   (setq d (entget e))
	   (= "INSERT" (cdr (assoc 0 d)))
	   )
    (command "_.layer" "_color" 8 (strcat (cdr (assoc 8 d)) "," (cdr (assoc 2 d)) "|*") ""))
  (princ)
  )  

 

Message 8 of 12

smallƑish
Advocate
Advocate

OMG !!! The Xref one is so amazing, LOved it thanks a lot.

0 Likes
Message 9 of 12

ndikesh
Contributor
Contributor

Hi @ВeekeeCZ

 

 The code is awesome, can it be modified so that it prompts to select objects/blocks instead of changing all objects?

 

Much appreciated,

Thanks.

0 Likes
Message 10 of 12

WeTanks
Mentor
Mentor

How should this XrefLayGrey LISP be used?

 

We.Tanks

EESignature

A couple of Fusion improvement ideas that could your vote/support:
図面一括印刷

0 Likes
Message 11 of 12

Sea-Haven
Mentor
Mentor

We did this for our field survey so existing features were set to grey, their layer name was also changed by adding "EX-" to layer name. To convert only certain items, we would have a text file with say block names and another with the layer names.

0 Likes
Message 12 of 12

fahedm6
Community Visitor
Community Visitor

Thanks! I was looking for it and not even chatgpt could help! your github?

0 Likes