Notifications
Clear all

[Closed] Save out poly amount to .txt file

i want to save out the poly amount to a .txt file

this is what i got so long
i just need help to save out the txt file

max select all
$.mesh.numfaces
5 Replies

max select all works because i only have models in my scene no lights or other junk

so this is what i have now but its not working

max select all
meshamount = $.mesh.numfaces
txt = meshamount 
f = (createFile "C://tmp.txt")
format txt to:f
(
	numFaces = 0
	for o in geometry do
	(
		numFaces += (getPolygonCount o)[1]
	)
	
	out_name = "D:\\meshFace.txt"
	out_file = createfile out_name
	format "%" numFaces to:out_file
	close out_file
)

In the maxscript reference file there is a good example: How To > Read and Write Geometry Data

thanks for the help but its not working

i get

– Error occurred in anonymous codeblock; filename: ; position: 2; line: 1
– Runtime error: FileStream cannot create: C:\meshFace.txt
– MAXScript callstack:
– thread data: threadID:32044


– [stack level: 0]
– In anonymous codeblock; filename: ; position: 155; line: 9
– Locals:
– numfaces: 474162
– out_name: “C:\meshFace.txt”
– out_file: undefined
– Externals:


– [stack level: 1]
– called from top-level

ok got to work just changed the path