Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

Maxscript to Create layers from a .txt file

Maxscript to Create layers from a .txt file

aliX8TFZ
Explorer Explorer
903 Views
3 Replies
Message 1 of 4

Maxscript to Create layers from a .txt file

aliX8TFZ
Explorer
Explorer

Hai there.,

How can i programmatically create layers., whose names are listed in a text file?

Every time i use some scripts to clean my scene all the objects will be merged to " 0 default " layer ., so i need to make layer structure again. I will create a text file with the list of layers i want to make. And i can give the path of file to crate layers with same names.

Im just a biginner of Maxscript . So please help me. Thank you

0 Likes
Accepted solutions (1)
904 Views
3 Replies
Replies (3)
Message 2 of 4

Swordslayer
Advisor
Advisor
Accepted solution

Simple flat layer structure?

(
	local file = openFile @"C:\folder\file.txt"
	while not EOF file do LayerManager.newLayerFromName (readLine file)
	close file
)

 

0 Likes
Message 3 of 4

aliX8TFZ
Explorer
Explorer

thanks for the quick solution

0 Likes
Message 4 of 4

aliX8TFZ
Explorer
Explorer

i went to your script page., Good works., Keep going👍

0 Likes