Запазване на цветовете на обектите при вмъкване на dwg файл в 3ds Max и преместването им в нов слой

Preserve the colors of objects when inserting dwg file into 3ds Max and moving them to new layer

Script details:

Name:Restore Imported Objects Wirecolor

Version:1.0

Author:Branko Živković

Web page:scriptspot.com

Compatible with 3ds Max:2010, +

If you paid attention you’ve probably noticed that when inserting dwg file into 3ds Max and move all CAD objects in new layer, they are losing its original colors and become white.

In case that you only import the drawing, without touching AutoCAD layers and objects inside, then everything is OK. But if you decide to group them in one new layer, then you get this lose of color.

Fortunately, this flaw is easily to overcome with the help of a small script. It was originally written by Jamie Cardoso, and later further developed by Branko Živković.

What you have to do is download the script and place it in one of Max’s folders in Windows Program files.

Save file restote-imported-objects-wirecolor.ms in MAXROOT > Scripts > Startup folder.

If you wish, you can create the script by yourself. What’s inside the file is this:

callbacks.removeScripts id:#rw
fn restoreWirecolor =
(
	undo off with redraw off
	(
		for o in objects where o.colorByLayer do
		(
			o.colorByLayer = off ; o.wirecolor = o.layer.wirecolor
		)
	)
)
callbacks.addScript #fileLinkPostAttach "restoreWirecolor()" id:#rw
callbacks.addScript #postImport "restoreWirecolor()" id:#rw

Save the code with .ms extension and move newly created file in “Startup” folder. And it is done!

Leave a comment

avatar
Sort by:   newest | oldest | most voted
wpDiscuz
Top