LoginSignup
1
1

More than 5 years have passed since last update.

MAXscriptでテキストにprintの内容を書き出す

Last updated at Posted at 2017-10-20

※バージョンは2015を使用しています。

テキストにprintの内容を書き出す

createFileName = maxFilePath + "text.txt" --<filename_string>

if (doesFileExist createFileName) == true then (print "同名のファイルがあります")
else(
    print "同名のファイルが無いのでファイル作成及び出力をします"
    createFileStream = createFile createFileName --<filestream>
    print "aaa" to:createFileStream
    close createFileStream
)

分かりにくかった点として、
<filename_string><filestream>は別モノだということ。
print "aaa" to:<filename_string> にするとエラーになってしまう。
あと、ファイルを扱う時の基本として、
closeでちゃんとファイルを閉じてやらないと、3DSMAXがずっとファイルを握っていてコントロールできなくなるので注意です。


1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1