Fusion Manage Forum
Welcome to Autodesk’s Fusion Manage (formerly Fusion 360 Manage) Forum. Share your knowledge, ask questions, and explore popular Fusion Manage topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Scripting newbie question

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
Bill.Bogan
547 Views, 4 Replies

Scripting newbie question

Is there a way to print to the screen, the contents of a variable? I'm want to use that to debug the script.

 

For example, the script GenUserInTeam

  1. Sets a variable 'usr' to the userID (what is the userID? Is it my SSO ID? Or something in my profile info?)
  2. Sets a variable to the users first and last names.
  3. At this point, I want to "see" the contents of 'usr' by printing a little dialog box with 'variable' = 'value' info.

Thanks,

Bill

4 REPLIES 4
Message 2 of 5
broepke
in reply to: Bill.Bogan

There sure is.... in the debugging page on help you'll find this:

 

http://help.autodesk.com/cloudhelp/ENU/PLM-360-Scripting/files/GUID-DEA5589D-275A-4DEF-8C83-9151AB0E...

 

Tip: For more sophisticated debugging of your scripts, you can use the print() and println() functions.

 

the second one puts a line break after each print statement - so if you print more than one variable to the screen it helps with readability.



Brian Roepke
Director, Analytics & Insights
Message 3 of 5
Bill.Bogan
in reply to: broepke

Thanks Brian. That bit of information took me from wondering what the issue is to identifying the issue and fixing it - in five minutes.

 

Over the course of several weeks I have spent portions of various days trying to figure out the issue, with no success.

So, this little bit of information would be very helpful to those of us who are novice scriptors.

 

Thanks,

Bill Bogan

Message 4 of 5
broepke
in reply to: Bill.Bogan

It's a great tip and invaluable in getting a script to work.

 

Over time we'll probably see additional debugging tools as well.  



Brian Roepke
Director, Analytics & Insights
Message 5 of 5
Anonymous
in reply to: Bill.Bogan

From another relative scripting newbie, a cautionary tale....

 

Remember that println is case sensitive - writing it with a Capital 'P' means it doesn't work - I caused myself much confusion with that!

 

 

I'm sure no-one else would make the same elementary mistake...!

 

Fiona

Tags (2)

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report