Help us understand the problem. What is going on with this article?

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

More than 1 year has passed since last update.

※バージョンは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がずっとファイルを握っていてコントロールできなくなるので注意です。


saty
3DCG artist
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした