I want to export script for summary info include Z dimension

Hello evryone i am a newbie !
I am a sculptor and i trying to make a sculpture ( a kind of pinscreen ) so there is a lot of objects ( 1515 ...) and i need there dimensions ( Z dimension exactly ) in order to build it....
So i need to create a text file .txt with the Z dimensions of all my objects withe there names ( for exemple cylinder 001 z dimension : 125,4 etc...)
Sorry for my poor english i am french.
Thanks a lot for any kind of help !
Cheers Julien

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Garp's picture

Salut Julien!

Ca fait plaisir de voir un français dans le coin. C'est pas souvent.

Tu dois sélectionner les objets dont tu veux la hauteur avant d'exécuter le script. Donc copie le code d'Anubis dans une nouvelle fenêtre de script, sélectionne et exécute (ctrl+e).
Remarque que là, tu obtiens la hauteur de chaque object sélectionné (point le plus haut moins point le plus bas). C'est-à-dire que si tu le bouges verticalement, le résultat est le même. Si c'est juste l'altitude du point le plus haut que tu veux, remplace
(obj.max.z - obj.min.z)
par
obj.max.z.

kidju07's picture

Thank you !!!

Merci beaucoup j avais vraiment besoin de se script !!

Anubis's picture

check the help-docs

Read "How To > Output Object Data To File"
in the mxs-reference to see how to works with files.

file = createFile "C:\\test.txt"
for obj in selection do
(
	n = obj.name
	d = (obj.max.z - obj.min.z)
	format "%,%\n" n d to:file
)
close file

my recent MAXScripts RSS (archive here)

adr.rocha's picture

Hello Anubis! You became as

Hello Anubis! You became as my savior!! I wasted more than 3 days searching for this answer!!! I was sure, it was supposed to be that simple, but i couldn't figure out. I have a script that exports only primitive. So when i needed to transform then into "poly", i couldn't export. There was a msg about "undefined property". So, thank you (a lot!!!).

kidju07's picture

How it works ?

Sorry i am really a noob i never work with script so i don ' t know how to use it... I tried to pad ste your lines into a maxscript then run it but nothing happens! Also tried to understand what it s explain in the doc ... but it s like chinese for me^^

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.