I want to set home view angles by keydown event .
I was able to control the camera .
How to use KeyDownEvent it can not be good .
For example,executed in the F1 key .
Please tell me !
(Since English is not good,can understand the meaning ?)
#Author- #Description- import adsk.core, adsk.fusion, traceback def move_camera(app, view): try: camera = view.camera target = adsk.core.Point3D.create(0,-1,0) eye = adsk.core.Point3D.create(1,0,1) camera.target = target camera.eye = eye camera.isFitView = True camera.isSmoothTransition = True view.camera = camera adsk.doEvents() view.refresh() except: ui = app.userInterface if ui: ui.messageBox('Failed:\n{}'.format(traceback.format_exc())) def main(): ui = None try: app = adsk.core.Application.get() move_camera(app, app.activeViewport) except: ui = app.userInterface if ui: ui.messageBox('Failed:\n{}'.format(traceback.format_exc())) main()
神原Θ友徳(かんばらΘとものり)Tomonori Kanbara -JAPAN-
この投稿が参考になりましたら、「いいね」を押してください。
この投稿で問題を解決できましたら、「解決策として承認」ボタンを押してください。
Solved! Go to Solution.
Solved by marshaltu. Go to Solution.
Hello,
Unfortunately our Fusion 360 APIs only support key event for API command(e.g. adsk.core.Command.keyDown, keyUp). You may have to pursue a solution from general language(Python)'s perspective. I saw some related questions were raised in stackoverflow as well.
http://stackoverflow.com/questions/694296/detect-in-python-which-keys-are-pressed
Thanks,
Marshal
Thank you for your answer.
I understand.
神原Θ友徳(かんばらΘとものり)Tomonori Kanbara -JAPAN-
この投稿が参考になりましたら、「いいね」を押してください。
この投稿で問題を解決できましたら、「解決策として承認」ボタンを押してください。