Printing infos to terminal with python

Printing infos to terminal with python

Anonymous
Not applicable
2,832 Views
6 Replies
Message 1 of 7

Printing infos to terminal with python

Anonymous
Not applicable

Hello,

I started using Fusion's Python API but i'm not able to see where the content is shown when the "print" command is used. As I am launching the script from the "scripts & add-ins" window, nothing is shown in my VS Code terminal and I did not find a python terminal in Fusion.... And when I am trying to launch the script from VS Code (so that the print commands are shown in the terminal), it tells me the adsk module is missing....

 

For now I'm using the ui.MessageBox() as a print command but it's really not ideal...

 

Best regards

 

Luc

0 Likes
Accepted solutions (1)
2,833 Views
6 Replies
Replies (6)
Message 2 of 7

PinRudolf
Advocate
Advocate
Accepted solution

There is a nice article from Adam Nagy discussing some options: Mod the Machine: Log debug messages in Fusion 360 (typepad.com)

Message 3 of 7

goyals
Autodesk
Autodesk

@Anonymous In next Fusion update, we are going to provide 'log' method which allow add-ins to print the message in Fusion text command window which can probably serve the purpose of print function. Thanks.



Shyam Goyal
Sr. Software Dev. Manager
Message 4 of 7

Anonymous
Not applicable

thanks for the link ! it worked as expected !! 🙂

0 Likes
Message 5 of 7

Anonymous
Not applicable

okay thanks for the infos ! I'm looking forward to see it in the next version !

0 Likes
Message 6 of 7

therealsamchaney
Advocate
Advocate

Thanks @goyals, is the log method you mentioned app.log()? If so, where can we find the log to read the results? Is it a flat file, or can we view it live in the Fusion GUI?

 

Thanks!

-Sam

0 Likes
Message 7 of 7

kandennti
Mentor
Mentor
0 Likes