objects for loop
Hi!
Im using
txt = ""
for i in selection do
(
txt += (i.name + " = " + ((i.transform.position) as string) + "\n")
)
f = createfile "C:\\file.txt"
format txt to: f
close f
what id like to get are positions of selected build in same order as below regardless order of selecting.
Could somebody point me to good source for getting into that? or maybe someone has ready solution?
Ty :)
m1 = getNodeByName "Basement"
m2 = getNodeByName "Window Front1"
m3 = getNodeByName "Window Front2"
m4 = getNodeByName "Window Front3"
m5 = getNodeByName "Window Front4"
m6 = getNodeByName "Doors"
m7 = getNodeByName "Wall N"
m8 = getNodeByName "Wall E"
m9 = getNodeByName "Wall S"
m10 = getNodeByName "Wall W"
m11 = getNodeByName "Roof"
Comments
I see so Amstia wanted
I see so Amstia wanted custom order - not alphabetically, so if the objects names are hard coded (not relative), just need to define them manual into array. Now i see so even "n.name" can be replaced with loop index (i) to optimize build string part of the code:
txt += (i + " = " + ((n.transform.position) as string) + "\n")
my recent MAXScripts RSS (archive here)
in order to keep your
in order to keep your objects together depending on their names you can create an array with the names only and then sort it:
txt = "" myArray =
my recent MAXScripts RSS (archive here)