Message 1 of 1
pymxs undo (basic python)

Not applicable
12-09-2020
09:45 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi guys, I just read document(https://help.autodesk.com/view/3DSMAX/2018/ENU/?guid=__developer_pymxs_api_introduction_html)and try following code.
# main.py
import pymxs
rt = pymxs.runtime
with pymxs.undo(False):
t = rt.Teapot()
with pymxs.undo(True):
t.pos = rt.Point3(20,20,20)
pymxs.run_undo() # undo the position
Teapot should be located in 0,0,0 but It's location is still 20, 20, 20
The reason is I am try using python.ExecuteFile in Maxscript like below image
In main.py, pymxs.run_undo() is done first.. I don't know why
Everything is works! like below image (0,0,0)
Why not operate normally using 'pythonExecuteFile'?
I want use pythonExecuteFile. Do you have any good ideas?
Please give me some advice.