Hi,
I'm trying to execute my python script from command lind.Inside the script I want to opne a max file and get some information.But I don't want to do that with : 3dsmax -U PythonHost demo.py Since it will show the print message inside MAXScript Listenser instead showing in the cmd console.
Now I execute python script in cmd :
python demo.py
Inside demo.py I use MaxPlus.FileManager to open max file :
MaxPlus.FileManager.Open("D:\test.max")
However when using MaxPlus.FileManager APIs will always cause "Unknown MaxPlus Exception",
Other MaxPlus APIs work just fine ,ex. MaxPlus.Application
Does anyone know what cause the exception?
and How to solve it?
Thank you so much!
The code below works fine on my side.
<code_begin>
import MaxPlus
fm = MaxPlus.FileManager
fm.Open("C:/temp/test.max")
<code_end>
I hope this helps.
im having trouble even import MaxPlus library.
im using the python command line.
is there something i need to do to point python to this library? in my windows path variable or something??
or do i have to use a specific shell or editor?
or do i have have to cd into a driectory first before running the import command?
im using 3dsmax 2015
thanks!
The MaxPlus Python library is designed to execute within an instance of Max. You can't use it outside the Max environment, such as in a Python command line.
Yes it's interesting that it can import, I had to try it out to see for myself. But most calls (including most MaxPlus.Application methods) just crash with an unknown exception.