Question about "FreeCAD.Console.PrintMessage" 0.19

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
jiong_yang
Posts: 3
Joined: Tue Jan 11, 2022 3:02 am

Question about "FreeCAD.Console.PrintMessage" 0.19

Post by jiong_yang »

This is the first time I use FreeCAD. I have seen many people use "FreeCAD.Console.PrintMessage" to output information. I also try to use this function to output information, but I can't find where is information. I would like to ask where this information is output. Is it output to the python console?
Image
def btn(self):
FreeCAD.ActiveDocument.addObject("Part::Box", "Box")
FreeCAD.ActiveDocument.ActiveObject.Label = "Cube"
FreeCAD.ActiveDocument.ActiveObject.Length = 10 #float(self.lineEdit.text())
FreeCAD.ActiveDocument.ActiveObject.Width = 30 #float(self.lineEdit_2.text())
FreeCAD.ActiveDocument.ActiveObject.Height = 10 #float(self.lineEdit_3.text())
FreeCAD.ActiveDocument.recompute()
FreeCAD.Console.PrintMessage('Hello, World!')
FreeCADGui.SendMsgToActiveView("ViewFit")
Attachments
2022-01-14_20-13-32.jpg
2022-01-14_20-13-32.jpg (317.61 KiB) Viewed 1129 times
chrisb
Veteran
Posts: 53919
Joined: Tue Mar 17, 2015 9:14 am

Re: Question about "FreeCAD.Console.PrintMessage" 0.19

Post by chrisb »

Hi and welcome to the forum!

Please edit your post and enclose the code in code-tags for improved readability.

The output goes to report view. This may depend on the settings in Preferences/General/Output window.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
jiong_yang
Posts: 3
Joined: Tue Jan 11, 2022 3:02 am

Re: Question about "FreeCAD.Console.PrintMessage" 0.19

Post by jiong_yang »

Thank you very much! It depends on the setting View-Panels -Report View.
chrisb
Veteran
Posts: 53919
Joined: Tue Mar 17, 2015 9:14 am

Re: Question about "FreeCAD.Console.PrintMessage" 0.19

Post by chrisb »

jiong_yang wrote: Mon Jan 17, 2022 3:51 am Thank you very much! It depends on the setting View-Panels -Report View.
You're welcome. How about improving your first post anyway?
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
jiong_yang
Posts: 3
Joined: Tue Jan 11, 2022 3:02 am

Re: Question about "FreeCAD.Console.PrintMessage" 0.19

Post by jiong_yang »

It is very helpful. This question has been fixed.
Post Reply