Using include with refresh function?

Using include with refresh function?

Anonymous
Not applicable
741 Views
2 Replies
Message 1 of 3

Using include with refresh function?

Anonymous
Not applicable
Hi

I'm developing a personal tool to help me work faster.
Since I'm new to maxscript I'm hoping someone can help me out with this.

The problem is with the include command. I'm generating an external .ms file
that loads into my maxfloater. This works ok, but it doesn't update
when overwriting the external file. How can I set it up so that when the
script starts up, it automaticly includes the correct(version) ?

Also, is it possible to refresh the included ms file once the script is running?


BR,
Aplomo

0 Likes
742 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
Include() is a compile-time statement and cannot use programmable paths (like a path variable etc.)
Thus, the string you pass to the include() cannot be changed easily. It is meant mainly for splitting the source of your script into multiple pieces to reduce the individual file size of your code sources.

Have you looked into using FileIn() instead? Other than include, it can use a variable as argument and is great for dynamically loading MS files.
The main drawback is that it does not retain the scope the way include() does, anything you fileIn will be evaluated in the global scope. But in most cases, this is rather useful - after all, you want your main script to be able to see whatever was loaded...
0 Likes
Message 3 of 3

Anonymous
Not applicable
Thanks Bobo!
0 Likes